It's not a fast solution: 1. converting each number to decimal value costs O(n) time, so in total it costs O(n^2) time. 2. sorting costs O(n.log(n)). 3. finding the first missing number costs O(n) So the time complexity will be O(n^2)
@@HarshaVardhan-fu9kv I'm done, after reading your comment I don't know what to say. Similarly, by using selection sort, at each step we just need to iterate through at most 16 elements, so the sorting step costs O(n). The total complexity reduces to O(n), that's so amazing. Just go back to your university and re-enroll in the Complexity Analysis class to learn Complexity Analysis on ALGORITHM, not on ALGORITHM WITH BOUNDED INPUT
I learnt multiple new concepts
the last solution is called Cantor's Diagonal Argument.
bro upload a video how to use codeforces effectively
Why not just sort the strings according to their decimal value and return the first missing number
It's not a fast solution:
1. converting each number to decimal value costs O(n) time, so in total it costs O(n^2) time.
2. sorting costs O(n.log(n)).
3. finding the first missing number costs O(n)
So the time complexity will be O(n^2)
Converting binay to decimal number is O(16) only as max length is 16
@@HarshaVardhan-fu9kv I'm done, after reading your comment I don't know what to say. Similarly, by using selection sort, at each step we just need to iterate through at most 16 elements, so the sorting step costs O(n). The total complexity reduces to O(n), that's so amazing. Just go back to your university and re-enroll in the Complexity Analysis class to learn Complexity Analysis on ALGORITHM, not on ALGORITHM WITH BOUNDED INPUT