Dhanushdhanushprofile.hashnode.dev·Mar 14, 2024Reverse Array - Java ProgramSolution in Java: import java.util.*; import java.io.*; class ReverseArray{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int arr[] = new int[n]; for(int i=0; i<n; i++){ arr[i] = sc.nextInt(); } f...Discuss·1 likeJavaJava
Akshima Sharmakeycomputereducation.hashnode.dev·Feb 6, 2024Reverse the array - 450DSA Cracker SolutionReverse a String Given a String S , print the reverse of the string as output. class Solution { public: string revStr(string S) { for(int i = 0, j= S.length()-1; i<j ;i++,j--) { swap(S[i], S[j]); } re...Discuss·20 likes450 DSA Series450dsa
Gulshan Kumarperfinsights.hashnode.dev·Nov 23, 2023Reverse the stringQ - You are given a string s. You need to reverse the string. GeekForGeeks Problem - Link | Click Here class Reverse { // Method to reverse a given string public static String reverseWord(String str) { // Get the length of the input s...DiscussJava SolutionJava
Sirisha Challagirisirishachallagiri.hashnode.dev·Nov 16, 2023Reverse words in a stringReversing the words in a string. For reversing the string you can refer below link. Reverse of a string Approach1: public class ReverseWordString { public static void main(String[] args) { String s = "code with siri"; System.out.println(s);...DiscussCode With SiriJava
Sirisha Challagirisirishachallagiri.hashnode.dev·Nov 10, 2023Reverse of a stringMethod 1: public class StringReverse { public static void main(String[] args) { String s = "code with siri"; String str=""; System.out.println("Original"+s); for(int i=s.length()-1;i>=0;i--){ str = str+s.charAt(i); } S...Discuss·1 like·28 readsCode With SiriJava
Sawan Badhwarsawan1367.hashnode.dev·Nov 3, 2023Day 6 but Day 4 of RecursionHello! everyone, it's nice to interact and share my experiences with you. I hope you like my blogs. As we were going through the topics of recursion, we also tried to solve a few of the questions with the help of recursion. However, solving only a fe...Discuss·10 likes#Palindrome
Gulshan Kumarperfinsights.hashnode.dev·Nov 1, 2023Reverse words in a given string.Write a Java program that takes a string S as input and reverses the order of the words while keeping the individual words unchanged. The input string will be a series of words separated by dots (.). Question - GeeksForGeeks import java.awt.*; import...DiscussJava Solution Paradigm Java
Gulshan Kumarperfinsights.hashnode.dev·Nov 1, 2023Java String Manipulation: Reversing Word Order in a SentenceQ - Write a Java program that reverses the order of words in a given sentence. import java.awt.*; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.Scanner; import static jav...DiscussJava Solution Paradigm Java
Luqman Shabanluqmanshaban.hashnode.dev·Aug 13, 2023Reverse Vowels of a StringHey there! Welcome back again. In this subsequent article, we'll go through the process of solving the reverse vowels leetcode challenge. Here is the task we're given:Given a string s, reverse only all the vowels in the string and return it.The vowel...Discussdata structures
Navnath Jadhavnavnathjadhav.hashnode.dev·Mar 25, 2023String Reverse in Java: Single Line SolutionProgram to Reverse a String Input: str="Navnath" Original String is: "Navnath" Output: revstr="htanvaN" Reverse String is: "htanvaN" Solution: Language Used: Java Approach 1: String Concatination import java.util.Scanner; public class reverse_stri...Discuss·2 likes·87 readsreverse string