Skip to main content

Posts

Showing posts from January, 2023

Want to Crack Java Coding Interview? Here is 4 Steps to follow - BlogonCode

Coding Interview in Java - Top four things to follow As a Developer, we all have to go through coding interview for any level job. So here we will seen how we can crack coding interviews. Point to prepare before going to coding interview in Java : Java in-built classes and its methods Java collection framework and its hierarchy Data structure and algorithms Follow coding standards 1. Java in-built classes and its methods Java have so many in-built classes and its method like, String, StringBuffer, StringBuilder, Array, etc. These classes and its methods is so useful in our every coding life. So before coding interview, we must have to gain knowledge about classes and its frequently used methods. String : length(), split(), charAt(), indexOf(), equals(), trim(). Array : sort(), length (not a method). Math : abs(), pow(), max(), min(). System   Scanner These are just a few examples of Java in-built classes and their methods. Java has a rich set of classes and libraries to help ...

Check if two strings after processing backspace character are equal or not

Java Solution for Backspace String Compare Problem Description : Given two strings s1 and s2, in which backspaces are represented by #. The task is to determine whether the resultant strings after processing the backspace character would be equal or not. Example 1 : Input : s1 = "abcd#" s2 = "abc" Output : true Explanation : s1 become "abc" after backspace d character and s2 is already "abc" Example 2 : Input : s1 = "abc#" s2 = "abc" Output : false Explanation : s1 become "ab" after backspace c character and s2 is "abc" Example 3 : Input : s1 = "ab##c" s2 = "ac" Output : false Explanation : s1 become "c" after backspace and s2 is "ac" Example 4 : Input : s1 = "abcdefg" s2 = "abcdefi#g" Output : false Here we have to delete last character if '#' (backspace) present in given String s1 or String s2. After that compare both string and if s1 and...