Posts

Showing posts from February, 2024

Recursive Sequence Geeks For Geeks Problem Of The Day 12-02-2024

Problem Link: https://www.geeksforgeeks.org/problems/recursive-sequence1611/1 Code: class Solution{     static long sequence(int n){                 long sum=0;         int pointer=0;                  int mod=1000000007;         int pointer2=1;                  for(int i=1;i<n+1;i++){            pointer=i;            long val=1;            int mul=pointer2;            for(int j=0;j<pointer;j++){                val=(val*mul)%mod;                mul++;            }            pointer2=mul;            sum=(sum+val)%mod; ...

Java Date And Time HackerRank

CODE:   public   static  String findDay( int  month,  int  day,  int  year) {         String finalday= " " ;          try {             String d1= day+ "/" +month+ "/" +year;             SimpleDateFormat sdf= new  SimpleDateFormat( "dd/MM/yyyy" );             Date date1=sdf.parse(d1);             DateFormat format1= new  SimpleDateFormat( "EEEE" );            finalday=format1.format(date1);              // return finalday;      ...