Sirisha Challagirisirishachallagiri.hashnode.dev·Nov 22, 20231859. Sorting the SentenceA sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each word consists of lowercase and uppercase English letters. A sentence can be shuffled by appending the 1-indexed word position to each word and...2 likesCode With Sirisorting string
Sirisha Challagirisirishachallagiri.hashnode.dev·Nov 21, 20231528. Shuffle StringYou are given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the i<sup>th</sup> position moves to indices[i] in the shuffled string. Return the shuffled string. Example 1: Example...5 likesCode With Sirileetcode
Sirisha Challagirisirishachallagiri.hashnode.dev·Nov 15, 2023Factorial of a numberFactorial of a non-negative number is the multiplication of all positive numbers that are smaller than are equal to n. Formula: n! = n*(n-1)\(n-2)*... 2\1 n=5 => 5*4*3*2*1 n=5 => 1*2*3*4*5 factorial of 5 is 120 0! = 1 Factorial using for loop: public...1 likeCode With SiriJava
Sirisha Challagirisirishachallagiri.hashnode.dev·Nov 11, 2023Swapping of two numbersswapping two numbers by using a temporary variable public class Swap { public static void main(String[] args) { int a=10,b=20; System.out.println("Before swapping: a="+a+",b="+b); int temp = a; a = b; b=temp; System.err.prin...1 likeCode With SiriJava