Posts

Showing posts from April, 2021

Tech Of The Day : Google Search for Mars Helicopter ‘Ingenuity NASA’ to Launch a Surprise on Your Screen

Image
  Google Search for Mars Helicopter ‘Ingenuity NASA’ to Launch a Surprise on Your Screen  NASA Mars helicopter Ingenuity became the first aircraft in history to make a controlled flight on another planet on Monday, April 19. To celebrate the achievement, Google has created an exciting new animation on its homepage. If you run a Google search for ‘Ingenuity NASA', a small and animated version of ‘Ingenuity', orange in color, appears on the screen. With its rotors whirling, clicking on the animation launches the Ingenuity for a flight around your screen over an animated red surface, similar to that of Mars or the Red Planet.

Code of the Day: String to Integer (ATOI)

  String to Integer (atoi) Implement the  myAtoi(string s)  function, which converts a string to a 32-bit signed integer (similar to C/C++'s  atoi  function). The algorithm for  myAtoi(string s)  is as follows: Read in and ignore any leading whitespace. Check if the next character (if not already at the end of the string) is  '-'  or  '+' . Read this character in if it is either. This determines if the final result is negative or positive respectively. Assume the result is positive if neither is present. Read in next the characters until the next non-digit charcter or the end of the input is reached. The rest of the string is ignored. Convert these digits into an integer (i.e.  "123" -> 123 ,  "0032" -> 32 ). If no digits were read, then the integer is  0 . Change the sign as necessary (from step 2). If the integer is out of the 32-bit signed integer range  [-2 31 , 2 31  - 1] , then clamp the integer so that it remains in the range. Specif

Tech Of the Day: Greenfield

Greenfield Greenfield is a term from the construction industry that refers to undeveloped land. In the  IT  world, greenfield describes a  software  project that is developed from scratch rather than built from an existing program. It is often contrasted with " brownfield ," which describes software built from an existing  program . Greenfield software development is generally more  flexible  than brownfield development since a new program does not need to fit a specific mold. For example, a greenfield  word processo r  might provide a completely new  user interface  and may have features not available in any previous program. Additionally, greenfield software does not need to be backwards compatible with older versions of a program. There is no need to support legacy  file formats  or include previous features to meet  end user  expectations. While greenfield projects are open ended, developing software from scratch involves inherent risk. For example, there may not be as la

Code Of The Day: Google Kick Start Problem

  K-Goodness String Problem Charles defines the goodness score of a string as the number of indices  i i  such that  S i ≠ S N − i + 1 S i ≠ S N − i + 1  where  1 ≤ i ≤ N / 2 1 ≤ i ≤ N / 2  ( 1 1 -indexed). For example, the string  CABABC  has a goodness score of  2 2  since  S 2 ≠ S 5 S 2 ≠ S 5  and  S 3 ≠ S 4 S 3 ≠ S 4 . Charles gave Ada a string  S S  of length  N N , consisting of uppercase letters and asked her to convert it into a string with a goodness score of  K K . In one operation, Ada can change any character in the string to any uppercase letter. Could you help Ada find the  minimum  number of operations required to transform the given string into a string with goodness score equal to  K K ? Input The first line of the input gives the number of test cases,  T T .  T T  test cases follow. The first line of each test case contains two integers  N N  and  K K . The second line of each test case contains a string  S S  of length  N N , consisting of uppercase letters. Output F