I am unable to solve the question called “Form Biggest Number”
Link : https://hack.codingblocks.com/contests/c/537/1291
I have approached the problem and came up with the following solution:
- Find all the permutations of string
- For each permutation of string:
a. Compare whether the current permutation of string is greater than last permutation
i. If greater then : assign max to current permutation of string
I am compairing two strings by lopping through each string and converting each character to int and compairing them.
This algo/steps is giving me wrong answer. Can you suggest what I am doing wrong here ?
Thanks