https://ide.codingblocks.com/s/233230… with 10^6 it is working fine but with 10^7 it is showing error… plz help
I am not able to make array of size 10^7 , everything else is right
since 10^7 is too big i.e range of numbers is bigger than total number of unique numbers it is recommended to use map
Code using map