This file contains hidden or 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
class Solution: | |
def countStudents(self, stu: List[int], sand: List[int]) -> int: | |
c=0 | |
for i in sand: | |
if i not in stu: | |
break | |
else: | |
c+=1 | |
stu.pop(stu.index(i)) | |
return len(sand)-c |
This file contains hidden or 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 class ThreadingProg { | |
public static void main (String[] args) { | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
System.out.println("1st Thread spawned"); | |
int random = (int)(Math.random() * 1000 + 1); | |
System.out.println("Random number is " + random); |
This file contains hidden or 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
interface AnimalHunt{ | |
abstract void hunt(); | |
} | |
interface AnimalEat { | |
abstract void eat(); | |
} | |
class Tiger implements AnimalHunt, AnimalEat{ | |
@Override |
This file contains hidden or 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
// Java program to reverse a number | |
import java.util.Scanner; | |
class ReverseInt | |
{ | |
/* Iterative function to reverse | |
digits of num*/ | |
static int reversDigits(int num) throws IntOutOfRangeException | |
{ |
This file contains hidden or 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
// a company wants me to create a game where a car, car should have its name , its topspeed and its wheelname | |
void main(){ | |
Bike bike= new Bike(); | |
bike.name ="pulsar"; | |
bike.no_of_wheels=2; | |
bike.speed_of_vehicle="130 rpm"; | |
bike.number_of_gears=4; | |
This file contains hidden or 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
// make a method that takes 2 numbers as its inputs . and returns the sum of those numbers . | |
void main() { | |
int result = addTwoNumbers(8765,1688); | |
print(result); | |
} |
This file contains hidden or 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 <iostream> | |
#include "LinkedList.h" | |
template <typename T> struct Node{ | |
T data; | |
Node* next; | |
}; | |
template <class T> class LinkedList { | |
private: |
This file contains hidden or 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
<?php | |
/* | |
http://localhost:8000/checkout?name=&contact=&check-in-date=2018-09-03&check-out-date=2018-09-07&rooms=01&adults=01&hotel_id=1&kids=01 | |
Use the above parameters for example | |
*/ | |
namespace App\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
This file contains hidden or 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 'package:flutter/material.dart'; | |
void main(){ | |
runApp( new WhatsApp()); | |
} | |
class WhatsApp extends StatefulWidget { | |
@override | |
_WhatsAppState createState() => _WhatsAppState(); | |
} |