File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed
kata/7-kyu/largest-square-inside-a-circle Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 11# [ Largest Square Inside A Circle] ( https://www.codewars.com/kata/largest-square-inside-a-circle " https://www.codewars.com/kata/5887a6fe0cfe64850800161c ")
22
3- Determine the ** area** of the largest square that can fit inside a circle with radius * r* .
3+ Determine the ** area** of the largest square that can fit inside a circle with radius * r* .
Original file line number Diff line number Diff line change 1+ interface Kata {
2+ static int areaLargestSquare (int r ) {
3+ return 2 * r * r ;
4+ }
5+ }
Original file line number Diff line number Diff line change 1+ import static org .junit .jupiter .api .Assertions .assertEquals ;
2+
3+ import org .junit .jupiter .params .ParameterizedTest ;
4+ import org .junit .jupiter .params .provider .CsvSource ;
5+
6+ class AreaLargestSquareTest {
7+ @ ParameterizedTest
8+ @ CsvSource (textBlock = """
9+ 5, 50
10+ 7, 98
11+ 15, 450
12+ """ )
13+ void sample (int r , int expected ) {
14+ assertEquals (expected , Kata .areaLargestSquare (r ));
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments