Its a standard question “Merge k sorted list/arrays”. Did you refer to geeksforgeeks code for comparison?
@vijju123, I have updated the post with problem link, please check.
And sorry about multiple revisions/edits, I tapped “Save edit” again and again because the site wasn’t loading quickly
I found the bug in my code. Now it gives TLE. At worst case, time complexity becomes linear when lower_bound finds an already assigned apartment. Here’s my code : 38QCMR - Online C++0x Compiler & Debugging Tool - Ideone.com
Can you elaborate the 2 pointer approach ?
Its taking time because of verification of 100% attendance laddus in my opinion. You will get them, just wait a few more days. Will ping @admin if you dont receive them after 2 days. Ok? 
import java.util.*;
public class ReverseNumber {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int times = sc.nextInt();
for(int i=0;i<times;i++)
{
String s1= sc.next();
StringBuilder sb = new StringBuilder(s1);
sb.reverse();
} System.out.println(sb);
}
}
This is my solution @aryanc403, Thanks in advance 
I dont get any context. And please dont upvote posts here, it makes it difficult for me to manage stuff here and I miss stuff. Upvote if I convert it to a question.
I actually never needed to do that. People knew how to not make a mod’s life difficult :3
XD
Haven’t gotten the laddus yet. Just need ~150 more to finally get my first t-shirt.
Your question was promoted to an individual question. Please refer to there.
We have to make minimum swaps so we have to always look from right side of string for first S which has a C directly to its left. Because by swapping rightmost CS to SC we can obtain the maximum decrease in power. In your code you start searching from left which leads to more swaps and hence wrong answer.
NZEC error in python is very common. Either input output or something else.
Q link please.
No. Its not strictly. I got laddus despite one of them being cancelled.
Thanks!
Can I get an upvote, so that I can ask questions?
Please use “Ask a Question” to ask if you have sufficient karma.
Good to hear dear 