Skip to content

Instantly share code, notes, and snippets.

View Alpha17-2's full-sized avatar
🎯
Focusing

Subhojeet Sahoo Alpha17-2

🎯
Focusing
View GitHub Profile
@Alpha17-2
Alpha17-2 / Aman_Birthday.java
Created August 5, 2020 06:40
Recursive approach
import java.util.*;
public class Aman_Birthday
{
static boolean found=false;
public static String reverse(String ans) // reverses the string
{
String ans2="";
for (int i = ans.length()-1; i >=0 ; i--) {
ans2=ans2+ans.charAt(i);
import java.util.*;
class Main
{
// Main Class
static char[][] a=new char[8][8];
public static void Fill(int r,int c,int n)
{
if (n==0)
return;
import java.util.*;
class Spacewars
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int[][] game_area=new int[100][100];
for (int i=0;i<100;i++)
{
for (int j=0;j<100;j++)
import java.util.*;
public class Last_n {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
int n = sc.nextInt();
int l=s.length();
String ans=s.substring(l-n,l);
for (int i=0;i<n-1;i++)
ans+=ans;
import java.util.*;
public class Newstring {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String a = sc.next();
String b = sc.next();
String ans = "";
int l1 = a.length(), l2 = b.length();
int i = 0, a1 = 0, b1 = 0;
while (a1 < l1 && b1 < l2)
import java.util.*;
public class RemoveStar
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
String s=sc.next();
int pos=0;
for (int i=0;i<s.length();i++)
{
/* Alpha_The_Coder */
import java.util.*;
public class EqualS {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int n = sc.nextInt();
String[] s = new String[n];
for (int i = 0; i < n; i++) // Input of strings
import java.util.*;
public class Changeten
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int n;
n=sc.nextInt();
long sum=0L;
long[] a=new long[n];
import java.util.*;
public class Changeten
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int n;
n=sc.nextInt();
int[] a=new int[n];
for (int i=0;i<n;i++)
/* Alpha_The_Coder
*/
import java.util.*;
public class Switch
{
static int rando() // Fucntion to find a random number between 0 to 9
{
Random rand = new Random();
int upperbound = 10;
int int_random = rand.nextInt(upperbound);