Skip to content

Sum int values in unsorted ArrayList based on dates

I’ve got a list of objects with LocalDateTime and int fields. Here is an example of an object from the list: How to check whether a sum of ints on a certain date (multiple entries for the same date possible) does not exceed some value for O(n) or better? forEach loop must be used, sorting is restricted.…

RegEx to find value in JSON

I need to write a RegEx on a JSON to match everything that starts with {$ and ends with } I tried with /{(.*?)}/g and it seemingly works fine but if you see the image below it also matches the other text so how do I explicitly write a RegEx for my requirement The reason for the ask is I

How to take n spaced input for multiple lines in java? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question 11 22 33 44 54 63 73 53 24 I am unable to take input in this format in java. I am comfortabl…

Trusted SSL certificate showing as self signed

I have a trusted TLS certificate deliverd by DigiCert that I’m trying to use in a java/spring application exposing rest apis. I created a .p12 file with openssl doing the following : openssl pkcs12 -export -in mycertificate.cer -certfile mycertificate_INTERMEDIATE.cer -inkey myprivate_key.key -out myCer…