2025-06-27 - Day 10 - 100 Days of Code

Hello, Friends -

Today’s problem was HackerRank again, Pattern Syntax Checker. It’s another regex problem. This time we’re tasked with finding out if a given string is a “valid” regular expression. This combines using Java Pattern and the PatternSyntaxException class imported from Java Util Regex. As mentioned previously, HackerRank requires the user to provide the code to pull in data from the console and in the past they pre-code the Java Scanner for this and so that’s what I’ve been using all this time. The Scanner class has a few options for “next” this or that. In a lot of these problems the first line of input is an integer to let the user know how many lines of text follow in the input. Java Scanner “nextInt()” returns this value successfully. However, today, I needed to use “nextLine()” for the subsequent lines of input and when combined with “nextInt()” for the first line, for some reason this was producing an empty string as the second line of text. When I switched this to “int n = Integer.parseint(sc.nextLine())” then the extra empty string suddenly disppeared. Yay.

Starting on Monday, July 7, and for the two weeks following, I will be participating in the IBM annual Qiskit Global Summer School (QGSS). Each year they focus on a different topic and this year is “The Past, Present, and Future of Quantum Computing”. I have registered for QGSS every year for the past five years but because I had a job at that time (and, some years, both a job and college) it was difficult to keep up with the material. I’m doing it right this year! Next week I’ll focus on the content from QGSS past years to - hopefully - get caught up and better familiarize myself with their SDK. I’m looking forward to this year and excited for the new content.

Stay tuned…

#100DaysOfCode

Published: June 27 2025

  • tags: