File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed
s2014_longest_subsequence_repeated_k_times Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,7 @@ public int count(int[] point) {
3434 int x1 = diap [0 ];
3535 int y1 = diap [1 ];
3636 int num = diap [2 ];
37- if (Math .abs (x - x1 ) != Math .abs (y - y1 ) || x == x1 || y == y1 ) {
38- continue ;
39- } else {
37+ if (Math .abs (x - x1 ) == Math .abs (y - y1 ) && x != x1 && y != y1 ) {
4038 int p1hash = x * MUL + y1 ;
4139 int p2hash = x1 * MUL + y ;
4240 if (map .containsKey (p1hash ) && map .containsKey (p2hash )) {
Original file line number Diff line number Diff line change 55
66import java .util .ArrayList ;
77
8+ @ SuppressWarnings ("unchecked" )
89public class Solution {
910 public String longestSubsequenceRepeatedK (String s , int k ) {
1011 char [] ca = s .toCharArray ();
11-
1212 char [] freq = new char [26 ];
1313 for (char value : ca ) {
1414 ++freq [value - 'a' ];
1515 }
16-
1716 ArrayList <String >[] cand = new ArrayList [8 ];
1817 cand [1 ] = new ArrayList <>();
1918 String ans = "" ;
You can’t perform that action at this time.
0 commit comments