MCPcopy Create free account
hub / github.com/Ayush7614/Daily-Coding-DS-ALGO-Practice / helper

Method helper

Gfg/Java/reverse-string.java:2–8  ·  view source on GitHub ↗
(char[] s, int left, int right)

Source from the content-addressed store, hash-verified

1class Solution {
2 public void helper(char[] s, int left, int right) {
3 if (left >= right) return;
4 char tmp = s[left];
5 s[left++] = s[right];
6 s[right--] = tmp;
7 helper(s, left, right);
8 }
9
10 public void reverseString(char[] s) {
11 helper(s, 0, s.length - 1);

Callers 1

reverseStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected