This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Dfs struct { | |
dX []int | |
dY []int | |
grid [][]byte | |
find byte | |
obstacle byte | |
found bool | |
} | |
func newDfs(grid [][]byte, find byte, obstacle byte) *Dfs { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strconv" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func reverse(arr []byte, start, end int) { | |
for i, j := start, end-1; i < end/2; i, j = i+1, j-1 { | |
arr[i], arr[j] = arr[j], arr[i] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static boolean isPrime(int x) { | |
if (x <= 1) return false; | |
if (x == 2 || x == 3 || x == 5) { | |
return true; | |
} | |
if (x % 2 == 0 || x % 3 == 0 || x % 5 == 0) { | |
return false; | |
} | |
int sqrt = (int) Math.floor(Math.sqrt(x)); | |
for (int i = 6; i <= sqrt; i += 6) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public java.lang.String toString() { | |
#if ( $members.size() > 0 ) | |
#set ( $i = 0 ) | |
return "{\"_class\":\"$classname\", " + | |
#foreach( $member in $members ) | |
#set ( $i = $i + 1 ) | |
#if ( $i == $members.size() ) | |
#set ( $postfix = "+" ) | |
#else | |
#set ( $postfix = "+ "", "" + " ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner sc=new Scanner(System.in); | |
double price=sc.nextInt(); | |
double discount=sc.nextInt(); | |
PercentageDiscount percentageDiscount=new PercentageDiscount(discount); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) throws FileNotFoundException { | |
Scanner sc=new Scanner(System.in); | |
File file = new File("residents.txt"); | |
sc = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int a,aa,b,bb,i,till; | |
scanf("%d",&till); | |
for (int j = 0; j < till; j++) | |
{ | |
scanf("%d %d",&a,&b); | |
if(a<b){ | |
int temp=b; | |
b=a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<string.h> | |
void _date_scraper(int size){ | |
char edir[]=":Mm.PpAa "; | |
float v_edir[]={5,2,2,4,2,2,2,2,1}; | |
float flag=0; | |
char temp[]="2am ki google am my god where i am 1230 uttara Dhaka pleaze let me in pizz papa dsdsdasdadsadsafsdfdsvxcv u 11:60 is big money mam k 12:30 AM k 12.30 ~"; | |
int i=0,j=0,till=0,found=0,p_till=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<string.h> | |
struct student | |
{ | |
char name[25];int id;int cgpa; | |
};int i=0; | |
struct student scan_and_print(); | |
void main(){ | |
struct student one=scan_and_print(); | |
struct student two=scan_and_print(); |