Problem:Subarray with distict elements

My submitted program shows error case case 1,2 and test case 3 is shown correct.So can you please help me understand where m doing it wrong

@shellcodingblock please save your code on ide.codingblocks.com and share the link.