https://ide.codingblocks.com/s/246348 sir in this code when i am doing cout then total string getting printed is n-1 i am not able to understant why , and plz check the code for string sort
Srring sort problem
actually it is printing 10 strings
first string is ā\nā
this is because when you provide n then there is ā\nā also present in the input buffer
so before taking other input you have to remove this ā\nā by using cin.get()
i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course
Sir can u tell me approach to sort the string if a string is completely present as a prefix in another string with longer length should be come first in can you tell me how to modify my code so all test case can be pass
it is difficult to make apply that condition here
also time complexity is O(N^2) so even after doing changes here will not able to pass testcase
use STL (sort function with custom comparator ) to solve this
Thank u sir my doubt is clear
Sir i am not getting that why we are not checking for false condition in compair funtion and if two string are of different length then also it will write true because as i will be same for both the string so it will entere in if condition
@anuragavm123 here a simple compare function
if string present as a subset then sort descend else ascend
i hope its clear if yes dont forget to mark it as resolved and hit like 
Yes sir i have some more doubt s in compair funtion
Sir i this compair funtion we are checking with the help of find funtion but why we are always returning a is great it may be there that b string can be great as we are checking for both
@anuragavm123 in question it is said to sort asc order and desc only in case if a mein b ya b mein a thats why did this
Okay thank u sir now i am able to get