We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e73219 commit 8d33874Copy full SHA for 8d33874
src/main/java/g1301_1400/s1392_longest_happy_prefix/Solution.java
@@ -5,10 +5,11 @@
5
6
public class Solution {
7
public String longestPrefix(String s) {
8
- char c[] = s.toCharArray();
+ char[] c = s.toCharArray();
9
int n = c.length;
10
- int a[] = new int[n];
11
- int max = 0, i = 1;
+ int[] a = new int[n];
+ int max = 0;
12
+ int i = 1;
13
while (i < n) {
14
if (c[max] == c[i]) {
15
max++;
0 commit comments