Implement a method: determine whether a number is a perfect square.
Java
How to output numbers and build a Map in one stream?
Tell about your previous project: stack, tasks.
Is it necessary to create a consumer group if there is only one consumer?
How else can you fix the problem with duplicates without using the merge function in toMap?
How to minimize backend memory load when reading data from the database, grouping, and sending a file to the frontend?
What is the difference in how a consumer works with an explicit group.id and without it?
How does a stream process elements — one by one or in batches?
```java import java.util.*; import java.lang.*; import java.io.*; class Codechef { public static void main (String[] args) throws java.lang.Exception { var autoNumbers = List.of(List.of("A123BC", "B421FT"), List.of("O543EC","B421FT", "I222OA")); autoNumbers.stream().flatMap(Collection::stream).flatEach(System.out/System.out.println()); Map<String, String> numberMap = autoNumbers.stream().flatMap(Collection::stream).collect(Collectors.toMap( n -> n, n -> n.replaceAll("[^0-9]", ""))); System.out.println(numberMap); } } ```
//list of car license plates, numbers are always of a standard type // need to output each number separately to the console // then create a map of the number - its digits (example A123BC:123) where the key is A123BC and the value is 123 //var autoNumbers = List.of(List.of("A123BC", "B421FT"), List.of("O543EC", "B421FT", "I2220A"));
Why is a cast to int used in line 24? What does Math.sqrt return?
How to implement isPerfectSquare without Math.sqrt? Alternative approaches.