.
Modifying board content breaks the random tests.
board
Sample tests contain a x, which is not a valid chess piece.
x
This comment is hidden because it contains spoiler information about the solution
"Given a number n, return the number of positive odd numbers below n, EASY!"
number of positive odd numbers
Teach me almighty one liner
The first sample test has an 'x' on the board. What does that represent?
Could've also used 1 in the place of 0 if im not mistaken...
genius!
needed to use use groups in the replacement
yeah for replacing matched groups we need parantheses
check this out for more info https://stackoverflow.com/questions/37734164/regex-backreferences-in-java
last two replaceAll calls can be condensed into replaceAll("^-|-$","").
Althought brackets arent necessary in this case they help to clarify the idea that lead to the solution :)
Loading collection data...
.
Modifying
board
content breaks the random tests.Sample tests contain a
x
, which is not a valid chess piece.This comment is hidden because it contains spoiler information about the solution
"Given a number n, return the
number of positive odd numbers
below n, EASY!"Teach me almighty one liner
This comment is hidden because it contains spoiler information about the solution
The first sample test has an 'x' on the board. What does that represent?
Could've also used 1 in the place of 0 if im not mistaken...
genius!
needed to use use groups in the replacement
yeah for replacing matched groups we need parantheses
check this out for more info
https://stackoverflow.com/questions/37734164/regex-backreferences-in-java
last two replaceAll calls can be condensed into replaceAll("^-|-$","").
This comment is hidden because it contains spoiler information about the solution
Althought brackets arent necessary in this case they help to clarify the idea that lead to the solution :)
Loading more items...