[Codewars] Binary multiple of 3

Binary multiple of 3

  • Time :
  • Space :
1
2
3
4
5
6
7
import java.util.regex.Pattern;

public class BinaryRegexp {
public static Pattern multipleOf3() {
return Pattern.compile("^(0|1(01*0)*1)*$");
}
}
Author: Song Hayoung
Link: https://songhayoung.github.io/2023/04/29/PS/Codewars/binary-multiple-of-3/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.