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; ...