IBM Latest HackerRank Coding Question | Easy Way Explanation✅ #ibm #hackerrank #ibmcodingquestion

preview_player
Показать описание
Hi Guys,
In this video I have discussed one IBM HackerRank Coding Question with Solution.I have tried my best to explain the problem with solution in a simple way.I hope this video will be helpful for you too in your preparation.
All the very best!!
If you have any question or doubts please feel free to ask me in the comments section.You can give any suggestions for my videos!

Hope this will help you too in your preparation :)
Thanks for watching the video! See you in the next video.... @quicklearninigwithsree

PlayList:
Рекомендации по теме
Комментарии
Автор

Code:-
import java.util.Scanner;

public class Solution1 {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();


}

public static String getLargestNumber(String num) {
return test(num);
}

public static String test(String s) {

String res = "";

for (int i = 0; i < s.length() - 1; i++) {
int n1 = s.charAt(i) - '0';// 5
int n2 = s.charAt(i + 1) - '0';// 9

if (n1 % 2 == 0 && n2 % 2 == 0 && n2 > n1) {
res += s.charAt(i + 1) + "" + s.charAt(i);
i++;
} else {
if (n1 % 2 != 0 && n2 % 2 != 0 && n2 > n1) {
+= s.charAt(i + 1) + "" + s.charAt(i);// 95

} else {
+= s.charAt(i);
}
}

if (i == s.length() - 2) {
res += s.charAt(i + 1);
}

}

if (s.equals(res)) {
return s;
} else {
return test(res);
}
}

}

quicklearninigwithsree
Автор

I have a doubt .. i have 2 hackerrank accounts .. the coding assesment link was sent on my mail 1 and i think the coding platform is open based on my mail 2 .. will it affect me ? When i finished the coding it showed me successfull and after closing the browser and opened the assesment link again it shows me the attend the test interface ?

So is my exam saved or reached to ibm or do i have to write exam once more ?

kingghost