Showing posts with label Coding. Show all posts
Showing posts with label Coding. Show all posts

Thursday, October 2, 2025

To check later palindrom what mistake i did. Earn Inte

 /*

A palindrome is a word that is the same when read left-to-right and right-to-left.  For example, “racecar” is a palindrome.

Given a string, find all of the substrings that are also palindromes.

Example input:

  "racecar"

Example output:

   [“racecar”, “aceca”, “cec”, “r”, “a”, “c”, “e”, “c”, “a”, “r”]
*/
import java.io.*;
import java.util.*;


class Solution {
  public static void main(String[] args) {

    String str = "racecar";
    ArrayList<String> resultSet = new ArrayList<String>();
   /*  
   for(int i = 0; i< str.length(); i++)
    {
       for(int j = i; j< str.length(); j++)
       {
          String subStr =str.substring(i, j+1);
          if(isPalindrome(subStr))
          {
              resultSet.add(subStr);
              System.out.println(subStr);
          }
       }
    }
    */
   int left = 0;
   int right = str.length();
   for(int i = 0; i< str.length(); i++)
   {
          int oddString = isPalindrome(str ,i,i);
          int evenString = isPalindrome(str ,i,i+1);

         
    }
   
   
  }


public static int isPalindrome(String str, int left, int right)
    {
        while(left>=0 && right < str.length() && str.charAt(left) == str.charAt(right))
        {
           
              left--;
              right ++;
               System.out.println(str.substring(left+1, right));
         
        }
       // System.out.println(str.substring(left+1, right));
        return right-left-1;
       
    }

    public static Boolean isPalindrome(String str)
    {
        int left = 0;
        int right = str.length() -1;
        for(int i = left; i< right; i++, right--)
        {
          if(str.charAt(i) != str.charAt(right))
          {
            return false;
          }
         
        }
        return true;
    }

   
}

Wednesday, September 24, 2025

Tuesday, September 9, 2025

Company wise interview questions

 https://leettracker-ff.web.app/questions

https://github.com/snehasishroy/leetcode-companywise-interview-questions

Tuesday, July 15, 2025

g-o-ogle

 // IP --> 10.10.20.1 --> Belong to a Subnet 10.10.0.0/16 16 = 255.255.0.0

// Dest --> Belongs to 10.10.0.0/16 -- //----

// Dest --> Belongs to 10.10.10.0/24 -- G2

// Implement an IP Route Lookup table for IPv4 addresses

// IP address is an 32 bit Integer or 4 Octets

// IP Addr & Subnet Mask =. Network Address


// IP = 10.10.20.1 --> AAA.BBB.CCC.DDD

//                     [A-Z].[A-Z]

//                     [[0-0][0-9[0-9]].[[0-0][0-9[0-9]].[[0-0][0-9[0-9]].[[0-0][0-9[0-9] 


multibit trie

Tuesday, June 17, 2025

C# javascript interview questions - CC FG

1.  server based connection - what is the page that goes with every request that knows this is the user

2. HTML difference between div and span

3. DOM - what is the tree like and what are its node?

4. .NET feature C# latest

5. 2 reference type - class array

6. var obj

7. Delete truncate

8. clustered non clustered


9. inner join outer join

10. datatypes in javascript

11. Ienumerable List

12. factory pattern

13. DI 

14. Difference between var let 


Behavioral questions