Snippets Collections
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Person {
    private String name;
    private int age;
    private double income;

    public Person(String name, int age, double income) {
        this.name = name;
        this.age = age;
        this.income = income;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public double getIncome() {
        return income;
    }
}

public class PersonExample {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        List<Person> setA = new ArrayList<>();

        // Read the number of persons
        System.out.print("Enter the number of persons: ");
        int n = scanner.nextInt();
        scanner.nextLine(); // consume newline character

        // Read details for each person
        for (int i = 0; i < n; i++) {
            System.out.println("Enter details for person " + (i + 1) + ":");
            System.out.print("Name: ");
            String name = scanner.nextLine();
            System.out.print("Age: ");
            int age = scanner.nextInt();
            System.out.print("Income: ");
            double income = scanner.nextDouble();
            scanner.nextLine(); // consume newline character

            // Create a new Person object and add it to the list
            Person person = new Person(name, age, income);
            setA.add(person);
        }

        // Initialize sets B, C, and B and C
        List<Person> setB = new ArrayList<>();
        List<Person> setC = new ArrayList<>();
        List<Person> setBC = new ArrayList<>();

        // Compute the sets
        for (Person person : setA) {
            if (person.getAge() > 60) {
                setB.add(person);
            }
            if (person.getIncome() < 10000) {
                setC.add(person);
            }
            if (person.getAge() > 60 && person.getIncome() < 10000) {
                setBC.add(person);
            }
        }

        // Print the results
        System.out.println("\nSet A:");
        for (Person person : setA) {
            System.out.println("Name: " + person.getName() + ", Age: " + person.getAge() + ", Income: " + person.getIncome());
        }

        System.out.println("\nSet B (age > 60):");
        for (Person person : setB) {
            System.out.println("Name: " + person.getName() + ", Age: " + person.getAge() + ", Income: " + person.getIncome());
        }

        System.out.println("\nSet C (income < 10000):");
        for (Person person : setC) {
            System.out.println("Name: " + person.getName() + ", Age: " + person.getAge() + ", Income: " + person.getIncome());
        }

        System.out.println("\nSet B and C (age > 60 and income < 10000):");
        for (Person person : setBC) {
            System.out.println("Name: " + person.getName() + ", Age: " + person.getAge() + ", Income: " + person.getIncome());
        }
    }
}
import java.util.TreeSet;
import java.util.Iterator;

public class TreeSetExample {
    public static void main(String[] args) {
        // Create a TreeSet
        TreeSet<String> fruits = new TreeSet<>();

        // Add elements to the TreeSet
        fruits.add("Apple");
        fruits.add("Banana");
        fruits.add("Cherry");
        fruits.add("Date");
        fruits.add("Elderberry");
        fruits.add("Fig");
        fruits.add("Grape");

        // Display the TreeSet
        System.out.println("Fruits in the TreeSet: " + fruits);

        // Attempt to add a duplicate element
        boolean isAdded = fruits.add("Apple");
        System.out.println("Attempt to add 'Apple' again: " + isAdded); // Should print false

        // Check the size of the TreeSet
        System.out.println("Size of the TreeSet: " + fruits.size());

        // Check if an element exists
        boolean containsCherry = fruits.contains("Cherry");
        System.out.println("Does the set contain 'Cherry'? " + containsCherry);

        // Remove an element
        fruits.remove("Banana");
        System.out.println("Fruits after removing 'Banana': " + fruits);

        // Iterate through the TreeSet using an Iterator
        System.out.println("Iterating through the TreeSet using an Iterator:");
        Iterator<String> iterator = fruits.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

        // Iterate through the TreeSet using a for-each loop
        System.out.println("Iterating through the TreeSet using a for-each loop:");
        for (String fruit : fruits) {
            System.out.println(fruit);
        }

        // Convert the TreeSet to an array
        Object[] fruitsArray = fruits.toArray();
        System.out.println("Fruits as an array:");
        for (Object fruit : fruitsArray) {
            System.out.println(fruit);
        }

        // Check if the TreeSet is empty
        System.out.println("Is the TreeSet empty? " + fruits.isEmpty());

        // Clone the TreeSet
        TreeSet<String> clonedFruits = (TreeSet<String>) fruits.clone();
        System.out.println("Cloned TreeSet: " + clonedFruits);

        // Clear the TreeSet
        fruits.clear();
        System.out.println("Is the TreeSet empty after clearing? " + fruits.isEmpty());

        // Add all elements from another collection
        TreeSet<String> moreFruits = new TreeSet<>();
        moreFruits.add("Kiwi");
        moreFruits.add("Lemon");
        moreFruits.add("Mango");
        fruits.addAll(moreFruits);
        System.out.println("Fruits after adding more fruits: " + fruits);

        // Retain only certain elements
        TreeSet<String> retainFruits = new TreeSet<>();
        retainFruits.add("Kiwi");
        retainFruits.add("Mango");
        fruits.retainAll(retainFruits);
        System.out.println("Fruits after retaining certain fruits: " + fruits);

        // Remove all elements from another collection
        fruits.removeAll(retainFruits);
        System.out.println("Fruits after removing retained fruits: " + fruits);

        // Accessing the first and last elements
        System.out.println("First fruit in the TreeSet: " + moreFruits.first());
        System.out.println("Last fruit in the TreeSet: " + moreFruits.last());

        // Subset of the TreeSet
        TreeSet<String> subSet = (TreeSet<String>) moreFruits.subSet("Kiwi", "Mango");
        System.out.println("Subset from 'Kiwi' to 'Mango': " + subSet);
    }
}
import java.util.LinkedHashSet;
import java.util.Iterator;

public class LinkedHashSetExample {
    public static void main(String[] args) {
        // Create a LinkedHashSet
        LinkedHashSet<String> fruits = new LinkedHashSet<>();

        // Add elements to the LinkedHashSet
        fruits.add("Apple");
        fruits.add("Banana");
        fruits.add("Cherry");
        fruits.add("Date");
        fruits.add("Elderberry");
        fruits.add("Fig");
        fruits.add("Grape");

        // Display the LinkedHashSet
        System.out.println("Fruits in the LinkedHashSet: " + fruits);

        // Attempt to add a duplicate element
        boolean isAdded = fruits.add("Apple");
        System.out.println("Attempt to add 'Apple' again: " + isAdded); // Should print false

        // Check the size of the LinkedHashSet
        System.out.println("Size of the LinkedHashSet: " + fruits.size());

        // Check if an element exists
        boolean containsCherry = fruits.contains("Cherry");
        System.out.println("Does the set contain 'Cherry'? " + containsCherry);

        // Remove an element
        fruits.remove("Banana");
        System.out.println("Fruits after removing 'Banana': " + fruits);

        // Iterate through the LinkedHashSet using an Iterator
        System.out.println("Iterating through the LinkedHashSet using an Iterator:");
        Iterator<String> iterator = fruits.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

        // Iterate through the LinkedHashSet using a for-each loop
        System.out.println("Iterating through the LinkedHashSet using a for-each loop:");
        for (String fruit : fruits) {
            System.out.println(fruit);
        }

        // Convert the LinkedHashSet to an array
        Object[] fruitsArray = fruits.toArray();
        System.out.println("Fruits as an array:");
        for (Object fruit : fruitsArray) {
            System.out.println(fruit);
        }

        // Check if the LinkedHashSet is empty
        System.out.println("Is the LinkedHashSet empty? " + fruits.isEmpty());

        // Clone the LinkedHashSet
        LinkedHashSet<String> clonedFruits = (LinkedHashSet<String>) fruits.clone();
        System.out.println("Cloned LinkedHashSet: " + clonedFruits);

        // Clear the LinkedHashSet
        fruits.clear();
        System.out.println("Is the LinkedHashSet empty after clearing? " + fruits.isEmpty());

        // Add all elements from another collection
        LinkedHashSet<String> moreFruits = new LinkedHashSet<>();
        moreFruits.add("Kiwi");
        moreFruits.add("Lemon");
        moreFruits.add("Mango");
        fruits.addAll(moreFruits);
        System.out.println("Fruits after adding more fruits: " + fruits);

        // Retain only certain elements
        LinkedHashSet<String> retainFruits = new LinkedHashSet<>();
        retainFruits.add("Kiwi");
        retainFruits.add("Mango");
        fruits.retainAll(retainFruits);
        System.out.println("Fruits after retaining certain fruits: " + fruits);

        // Remove all elements from another collection
        fruits.removeAll(retainFruits);
        System.out.println("Fruits after removing retained fruits: " + fruits);
    }
}
public class BoundedArithematic<T extends Number> {
    public double add(T a, T b) {
        return a.doubleValue() + b.doubleValue();
    }
    public double subtract(T a, T b) {
        return a.doubleValue() - b.doubleValue();
    }
    public double multiply(T a, T b) {
        return a.doubleValue() * b.doubleValue();
    }	
   public double divide(T a, T b) {
        if (b.doubleValue() == 0) {
            throw new ArithmeticException("Division by zero is not allowed.");
        }
        return a.doubleValue() / b.doubleValue();
    }
    public static void main(String[] args) {
        BoundedArithematic<Number> calculator = new BoundedArithematic<>();
        Integer a = 10;
        Integer b = 5;
        System.out.println("Addition: " + calculator.add(a, b));
        System.out.println("Subtraction: " + calculator.subtract(a, b));
        System.out.println("Multiplication: " + calculator.multiply(a, b));
        System.out.println("Division: " + calculator.divide(a, b));
    }
}
==
//Wildcard Arguments
public class MagicBox<T> {
    private T item;

    public void addItem(T item) {
        this.item = item;
        System.out.println("Added item to the magic box: " + item);
    }

    public T getItem() {
                return item;
    }

    public void processBox(MagicBox<? super Integer> box) {
        System.out.println("Items in the box are processed["+box.getItem()+"]"); 
    }

    public static void main(String[] args) {
        
        MagicBox<Integer> integerBox = new MagicBox<>();
        integerBox.addItem(43);
        		
		MagicBox<String> stringBox = new MagicBox<>();
        stringBox.addItem("Sofiya");
        	
		
        MagicBox<Boolean> booleanBox = new MagicBox<>();
        booleanBox.addItem(false);
        
		MagicBox<Object> dobubleBox = new MagicBox<>();
        dobubleBox.addItem(43.43);
		
		integerBox.processBox(integerBox);
		dobubleBox.processBox(dobubleBox);
		
		
		
        
    }
}
import java.util.HashSet;
import java.util.Iterator;

public class HashSetExample {
    public static void main(String[] args) {
        // Create a HashSet
        HashSet<String> fruits = new HashSet<>();

        // Add elements to the HashSet
        fruits.add("Apple");
        fruits.add("Banana");
        fruits.add("Cherry");
        fruits.add("Date");
        fruits.add("Elderberry");
        fruits.add("Fig");
        fruits.add("Grape");

        // Display the HashSet
        System.out.println("Fruits in the HashSet: " + fruits);

        // Attempt to add a duplicate element
        boolean isAdded = fruits.add("Apple");
        System.out.println("Attempt to add 'Apple' again: " + isAdded); // Should print false

        // Check the size of the HashSet
        System.out.println("Size of the HashSet: " + fruits.size());

        // Check if an element exists
        boolean containsCherry = fruits.contains("Cherry");
        System.out.println("Does the set contain 'Cherry'? " + containsCherry);

        // Remove an element
        fruits.remove("Banana");
        System.out.println("Fruits after removing 'Banana': " + fruits);

        // Iterate through the HashSet using an Iterator
        System.out.println("Iterating through the HashSet using an Iterator:");
        Iterator<String> iterator = fruits.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

        // Iterate through the HashSet using a for-each loop
        System.out.println("Iterating through the HashSet using a for-each loop:");
        for (String fruit : fruits) {
            System.out.println(fruit);
        }

        // Convert the HashSet to an array
        Object[] fruitsArray = fruits.toArray();
        System.out.println("Fruits as an array:");
        for (Object fruit : fruitsArray) {
            System.out.println(fruit);
        }

        // Check if the HashSet is empty
        System.out.println("Is the HashSet empty? " + fruits.isEmpty());

        // Clone the HashSet
        HashSet<String> clonedFruits = (HashSet<String>) fruits.clone();
        System.out.println("Cloned HashSet: " + clonedFruits);

        // Clear the HashSet
        fruits.clear();
        System.out.println("Is the HashSet empty after clearing? " + fruits.isEmpty());

        // Add all elements from another collection
        HashSet<String> moreFruits = new HashSet<>();
        moreFruits.add("Kiwi");
        moreFruits.add("Lemon");
        moreFruits.add("Mango");
        fruits.addAll(moreFruits);
        System.out.println("Fruits after adding more fruits: " + fruits);

        // Retain only certain elements
        HashSet<String> retainFruits = new HashSet<>();
        retainFruits.add("Kiwi");
        retainFruits.add("Mango");
        fruits.retainAll(retainFruits);
        System.out.println("Fruits after retaining certain fruits: " + fruits);

        // Remove all elements from another collection
        fruits.removeAll(retainFruits);
        System.out.println("Fruits after removing retained fruits: " + fruits);
    }
}
import java.util.LinkedList;

public class GenericQueue<T> {
    private LinkedList<T> queueList;

    public GenericQueue() {
        this.queueList = new LinkedList<>();
    }

    public void enqueue(T item) {
        queueList.addLast(item);
    }

    public T dequeue() {
        if (!queueList.isEmpty()) {
            return queueList.removeFirst();
        } else {
            System.out.println("Queue Underflow");
            return null;
        }
    }

    public boolean isEmpty() {
        return queueList.isEmpty();
    }

    public T peek() {
        if (!queueList.isEmpty()) {
            return queueList.getFirst();
        } else {
            return null;
        }
    }

    public static void main(String[] args) {
        GenericQueue<Integer> intQueue = new GenericQueue<>();
        intQueue.enqueue(1);
        intQueue.enqueue(2);
        intQueue.enqueue(3);
        intQueue.enqueue(4);
        intQueue.enqueue(5);

        System.out.println("Front element: " + intQueue.peek()); // 1

        while (!intQueue.isEmpty()) {
            System.out.println("Dequeued element: " + intQueue.dequeue());
        }

        System.out.println("Queue is empty: " + intQueue.isEmpty()); // true

        GenericQueue<String> stringQueue = new GenericQueue<>();
        stringQueue.enqueue("one");
        stringQueue.enqueue("two");
        stringQueue.enqueue("three");

        System.out.println("Front element: " + stringQueue.peek()); // one

        while (!stringQueue.isEmpty()) {
            System.out.println("Dequeued element: " + stringQueue.dequeue());
        }

        System.out.println("Queue is empty: " + stringQueue.isEmpty()); // true
    }
}
#include<bits/stdc++.h>
using namespace std;
const int N = 1e3+5;
vector<int> graph[N];
int main()
{
    int v,e,j,k;
    cin>>v>>e;
    for(int i=0;i<v;++i)
    {
        cin>>j>>k;
        graph[k].push_back(j);
        graph[j].push_back(k);
        
    }
}
#include<bits/stdc++.h>
using namespace std;
const int N = 1e3+5;
int graph[N][N];
int main()
{
    int v,e,j,k;
    cin>>v>>e;
    for(int i=0;i<e;++i)
    {
        cin>>j>>k;
        graph[i][j]=1;
        graph[j][i]=1;
        
    }
}
import java.util.Scanner;  

interface StringFunction {  
    String reverse(String input);  
}  
public class StringLambdaExample1 {  
    public static void main(String[] args) {  
    
        Scanner scanner = new Scanner(System.in);  
 
        StringFunction reverseFunction = (str) -> {  
            String reversedString = "";  
  
            for (int index = str.length() - 1; index >= 0; index--) {  
              
                reversedString += str.charAt(index);  
            }
            return reversedString;  
        };  
        String fixedString = " javaTpoint";  
        System.out.println("Reversed word using lambda function: " + reverseFunction.reverse(fixedString));  
        System.out.println("Enter a string to be reversed:");  
        String userInput = scanner.nextLine();  
        System.out.println("After reversing: " + reverseFunction.reverse(userInput));  
        scanner.close();  
    }  
}  
import java.util.ArrayList;

public class GenericQueue<T> {
    private ArrayList<T> queueList;

    public GenericQueue() {
        this.queueList = new ArrayList<>();
    }

    public void enqueue(T item) {
        queueList.add(item);
    }

    public T dequeue() {
        if (!queueList.isEmpty()) {
            return queueList.remove(0);
        } else {
            System.out.println("Queue Underflow");
            return null;
        }
    }

    public boolean isEmpty() {
        return queueList.isEmpty();
    }

    public T peek() {
        if (!queueList.isEmpty()) {
            return queueList.get(0);
        } else {
            return null;
        }
    }

    public static void main(String[] args) {
        GenericQueue<Integer> intQueue = new GenericQueue<>();
        intQueue.enqueue(1);
        intQueue.enqueue(2);
        intQueue.enqueue(3);
        intQueue.enqueue(4);
        intQueue.enqueue(5);

        System.out.println("Front element: " + intQueue.peek()); // 1

        while (!intQueue.isEmpty()) {
            System.out.println("Dequeued element: " + intQueue.dequeue());
        }

        System.out.println("Queue is empty: " + intQueue.isEmpty()); // true

        GenericQueue<String> stringQueue = new GenericQueue<>();
        stringQueue.enqueue("one");
        stringQueue.enqueue("two");
        stringQueue.enqueue("three");

        System.out.println("Front element: " + stringQueue.peek()); // one

        while (!stringQueue.isEmpty()) {
            System.out.println("Dequeued element: " + stringQueue.dequeue());
        }

        System.out.println("Queue is empty: " + stringQueue.isEmpty()); // true
    }
}
import java.util.LinkedList;

public class GenericStack<T> {
    private LinkedList<T> stackList;

    public GenericStack() {
        this.stackList = new LinkedList<>();
    }

    public void push(T item) {
        stackList.addFirst(item);
    }

    public T pop() {
        if (!stackList.isEmpty()) {
            return stackList.removeFirst();
        } else {
            System.out.println("Stack Underflow");
            return null;
        }
    }

    public boolean isEmpty() {
        return stackList.isEmpty();
    }

    public T peek() {
        if (!stackList.isEmpty()) {
            return stackList.getFirst();
        } else {
            return null;
        }
    }

    public static void main(String[] args) {
        GenericStack<Integer> intStack = new GenericStack<>();
        intStack.push(1);
        intStack.push(2);
        intStack.push(3);
        intStack.push(4);
        intStack.push(5);

        System.out.println("Top element: " + intStack.peek()); // 5

        while (!intStack.isEmpty()) {
            System.out.println("Popped element: " + intStack.pop());
        }

        System.out.println("Stack is empty: " + intStack.isEmpty()); // true

        GenericStack<String> stringStack = new GenericStack<>();
        stringStack.push("one");
        stringStack.push("two");
        stringStack.push("three");

        System.out.println("Top element: " + stringStack.peek()); // three

        while (!stringStack.isEmpty()) {
            System.out.println("Popped element: " + stringStack.pop());
        }

        System.out.println("Stack is empty: " + stringStack.isEmpty()); // true
    }
}
import java.util.ArrayList;

public class GenericStack<T> {
    private ArrayList<T> stackList;
    private int maxSize;

    public GenericStack(int size) {
        this.stackList = new ArrayList<>(size);
        this.maxSize = size;
    }

    public void push(T item) {
        if (stackList.size() < maxSize) {
            stackList.add(item);
        } else {
            System.out.println("Stack Overflow");
        }
    }

    public T pop() {
        if (!stackList.isEmpty()) {
            return stackList.remove(stackList.size() - 1);
        } else {
            System.out.println("Stack Underflow");
            return null;
        }
    }

    public boolean isEmpty() {
        return stackList.isEmpty();
    }

    public boolean isFull() {
        return stackList.size() == maxSize;
    }

    public T peek() {
        if (!stackList.isEmpty()) {
            return stackList.get(stackList.size() - 1);
        } else {
            return null;
        }
    }

    public static void main(String[] args) {
        GenericStack<Integer> intStack = new GenericStack<>(5);
        intStack.push(1);
        intStack.push(2);
        intStack.push(3);
        intStack.push(4);
        intStack.push(5);

        System.out.println("Stack is full: " + intStack.isFull()); // true
        System.out.println("Top element: " + intStack.peek()); // 5

        while (!intStack.isEmpty()) {
            System.out.println("Popped element: " + intStack.pop());
        }

        System.out.println("Stack is empty: " + intStack.isEmpty()); // true

        GenericStack<String> stringStack = new GenericStack<>(3);
        stringStack.push("one");
        stringStack.push("two");
        stringStack.push("three");

        System.out.println("Stack is full: " + stringStack.isFull()); // true
        System.out.println("Top element: " + stringStack.peek()); // three

        while (!stringStack.isEmpty()) {
            System.out.println("Popped element: " + stringStack.pop());
        }

        System.out.println("Stack is empty: " + stringStack.isEmpty()); // true
    }
}
class Node<T> {
    T data;
    Node<T> next;

    public Node(T data) {
        this.data = data;
        this.next = null;
    }
}

class GenericQueueArray<T> {
    private T[] queueArray;
    private int front, rear, size, capacity;

    @SuppressWarnings("unchecked")
    public GenericQueueArray(int capacity) {
        this.capacity = capacity;
        this.queueArray = (T[]) new Object[capacity];
        this.front = 0;
        this.rear = 0; // Initialize rear to be the same as front
        this.size = 0;
    }

    public void enqueue(T item) {
        if (isFull()) {
            System.out.println("Queue is full");
            return;
        }
        queueArray[rear] = item;
        rear = (rear + 1) % capacity;
        size++;
    }

    public T dequeue() {
        if (isEmpty()) {
            System.out.println("Queue is empty");
            return null;
        }
        T item = queueArray[front];
        front = (front + 1) % capacity;
        size--;
        return item;
    }

    public boolean isEmpty() {
        return size == 0;
    }

    public boolean isFull() {
        return size == capacity;
    }
}

class GenericQueueLinkedList<T> {
    private Node<T> front, rear;

    public GenericQueueLinkedList() {
        this.front = this.rear = null;
    }

    public void enqueue(T item) {
        Node<T> newNode = new Node<>(item);
        if (isEmpty()) {
            front = rear = newNode;
        } else {
            rear.next = newNode;
            rear = newNode;
        }
    }

    public T dequeue() {
        if (isEmpty()) {
            System.out.println("Queue is empty");
            return null;
        }
        T item = front.data;
        front = front.next;
        if (front == null) {
            rear = null;
        }
        return item;
    }

    public boolean isEmpty() {
        return front == null;
    }
}

public class GenericQueueExample {
    public static void main(String[] args) {
        // Static input for demonstration
        GenericQueueArray<Integer> intQueueArray = new GenericQueueArray<>(5);
        intQueueArray.enqueue(1);
        intQueueArray.enqueue(2);
        intQueueArray.enqueue(3);
        System.out.println("Array Queue Dequeue: " + intQueueArray.dequeue());
        System.out.println("Array Queue Dequeue: " + intQueueArray.dequeue());

        GenericQueueLinkedList<Integer> intQueueLinkedList = new GenericQueueLinkedList<>();
        intQueueLinkedList.enqueue(1);
        intQueueLinkedList.enqueue(2);
        intQueueLinkedList.enqueue(3);
        System.out.println("Linked List Queue Dequeue: " + intQueueLinkedList.dequeue());
        System.out.println("Linked List Queue Dequeue: " + intQueueLinkedList.dequeue());

        GenericQueueArray<Double> doubleQueueArray = new GenericQueueArray<>(5);
        doubleQueueArray.enqueue(1.1);
        doubleQueueArray.enqueue(2.2);
        doubleQueueArray.enqueue(3.3);
        System.out.println("Array Queue Dequeue: " + doubleQueueArray.dequeue());
        System.out.println("Array Queue Dequeue: " + doubleQueueArray.dequeue());

        GenericQueueLinkedList<Double> doubleQueueLinkedList = new GenericQueueLinkedList<>();
        doubleQueueLinkedList.enqueue(1.1);
        doubleQueueLinkedList.enqueue(2.2);
        doubleQueueLinkedList.enqueue(3.3);
        System.out.println("Linked List Queue Dequeue: " + doubleQueueLinkedList.dequeue());
        System.out.println("Linked List Queue Dequeue: " + doubleQueueLinkedList.dequeue());

        GenericQueueArray<String> stringQueueArray = new GenericQueueArray<>(5);
        stringQueueArray.enqueue("one");
        stringQueueArray.enqueue("two");
        stringQueueArray.enqueue("three");
        System.out.println("Array Queue Dequeue: " + stringQueueArray.dequeue());
        System.out.println("Array Queue Dequeue: " + stringQueueArray.dequeue());

        GenericQueueLinkedList<String> stringQueueLinkedList = new GenericQueueLinkedList<>();
        stringQueueLinkedList.enqueue("one");
        stringQueueLinkedList.enqueue("two");
        stringQueueLinkedList.enqueue("three");
        System.out.println("Linked List Queue Dequeue: " + stringQueueLinkedList.dequeue());
        System.out.println("Linked List Queue Dequeue: " + stringQueueLinkedList.dequeue());
    }
}
// Java program to implement Max Heap

// Main class
public class MaxHeap {
	private int[] Heap;
	private int size;
	private int maxsize;

	public MaxHeap(int maxsize)
	{
		this.maxsize = maxsize;
		this.size = 0;
		Heap = new int[this.maxsize];
	}

	private int parent(int pos) { return (pos - 1) / 2; }

	private int leftChild(int pos) { return (2 * pos) + 1; }
	private int rightChild(int pos)
	{
		return (2 * pos) + 2;
	}

	private boolean isLeaf(int pos)
	{
		if (pos > (size / 2) && pos <= size) {
			return true;
		}
		return false;
	}
	private void swap(int fpos, int spos)
	{
		int tmp;
		tmp = Heap[fpos];
		Heap[fpos] = Heap[spos];
		Heap[spos] = tmp;
	}

	private void maxHeapify(int pos)
	{
		if (isLeaf(pos))
			return;

		if (Heap[pos] < Heap[leftChild(pos)]
			|| Heap[pos] < Heap[rightChild(pos)]) {

			if (Heap[leftChild(pos)]
				> Heap[rightChild(pos)]) {
				swap(pos, leftChild(pos));
				maxHeapify(leftChild(pos));
			}
			else {
				swap(pos, rightChild(pos));
				maxHeapify(rightChild(pos));
			}
		}
	}

	public void insert(int element)
	{
		Heap[size] = element;

		int current = size;
		while (Heap[current] > Heap[parent(current)]) {
			swap(current, parent(current));
			current = parent(current);
		}
		size++;
	}

	public void print()
	{

		for (int i = 0; i < size / 2; i++) {

			System.out.print("Parent Node : " + Heap[i]);

			if (leftChild(i)
				< size) 
				System.out.print(" Left Child Node: "+ Heap[leftChild(i)]);
			if (rightChild(i)
				< size) 						
				System.out.print(" Right Child Node: "+ Heap[rightChild(i)]);

			System.out.println(); 		}
	}

	public int extractMax()
	{
		int popped = Heap[0];
		Heap[0] = Heap[--size];
		maxHeapify(0);
		return popped;
	}

	public static void main(String[] arg)
	{
		System.out.println("The Max Heap is ");

		MaxHeap maxHeap = new MaxHeap(15);

		maxHeap.insert(5);
		maxHeap.insert(3);
		maxHeap.insert(17);
		maxHeap.insert(10);
		maxHeap.insert(84);
		maxHeap.insert(19);
		maxHeap.insert(6);
		maxHeap.insert(22);
		maxHeap.insert(9);
		maxHeap.print();

		System.out.println("The max val is "+ maxHeap.extractMax());
	}
}
import java.util.Scanner;

// Node class for LinkedList-based stack
class Node<T> {
    T data;
    Node<T> next;

    public Node(T data) {
        this.data = data;
        this.next = null;
    }
}

// Generic stack implemented using arrays
class GenericStackArray<T> {
    private T[] stackArray;
    private int top;
    private int maxSize;

    @SuppressWarnings("unchecked")
    public GenericStackArray(int size) {
        this.maxSize = size;
        this.stackArray = (T[]) new Object[maxSize];
        this.top = -1;
    }

    public void push(T item) {
        if (top < maxSize - 1) {
            stackArray[++top] = item;
        } else {
            System.out.println("Stack Overflow");
        }
    }

    public T pop() {
        if (top >= 0) {
            return stackArray[top--];
        } else {
            System.out.println("Stack Underflow");
            return null;
        }
    }

    public boolean isEmpty() {
        return top == -1;
    }
}

// Generic stack implemented using linked lists
class GenericStackLinkedList<T> {
    private Node<T> top;

    public GenericStackLinkedList() {
        this.top = null;
    }

    public void push(T item) {
        Node<T> newNode = new Node<>(item);
        newNode.next = top;
        top = newNode;
    }

    public T pop() {
        if (top == null) {
            System.out.println("Stack Underflow");
            return null;
        }
        T data = top.data;
        top = top.next;
        return data;
    }

    public boolean isEmpty() {
        return top == null;
    }
}

public class GenericStackExample {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // Testing stack with array implementation
        GenericStackArray<Integer> intStackArray = new GenericStackArray<>(5);
        GenericStackArray<Double> doubleStackArray = new GenericStackArray<>(5);
        GenericStackArray<String> stringStackArray = new GenericStackArray<>(5);

        intStackArray.push(1);
        intStackArray.push(2);
        intStackArray.push(3);
        System.out.println("Popped from intStackArray: " + intStackArray.pop());

        doubleStackArray.push(1.1);
        doubleStackArray.push(2.2);
        doubleStackArray.push(3.3);
        System.out.println("Popped from doubleStackArray: " + doubleStackArray.pop());

        stringStackArray.push("Hello");
        stringStackArray.push("World");
        System.out.println("Popped from stringStackArray: " + stringStackArray.pop());

        // Testing stack with linked list implementation
        GenericStackLinkedList<Integer> intStackLinkedList = new GenericStackLinkedList<>();
        GenericStackLinkedList<Double> doubleStackLinkedList = new GenericStackLinkedList<>();
        GenericStackLinkedList<String> stringStackLinkedList = new GenericStackLinkedList<>();

        intStackLinkedList.push(1);
        intStackLinkedList.push(2);
        intStackLinkedList.push(3);
        System.out.println("Popped from intStackLinkedList: " + intStackLinkedList.pop());

        doubleStackLinkedList.push(1.1);
        doubleStackLinkedList.push(2.2);
        doubleStackLinkedList.push(3.3);
        System.out.println("Popped from doubleStackLinkedList: " + doubleStackLinkedList.pop());

        stringStackLinkedList.push("Hello");
        stringStackLinkedList.push("World");
        System.out.println("Popped from stringStackLinkedList: " + stringStackLinkedList.pop());

        scanner.close();
    }
}
import java.util.LinkedList;
import java.util.Iterator;

public class LinkedListIteratorExample {
    public static void main(String[] args) {
        // Create a LinkedList and add some fruit names
        LinkedList<String> fruits = new LinkedList<>();
        fruits.add("Apple");
        fruits.add("Banana");
        fruits.add("Cherry");
        
        // Obtain an iterator for the LinkedList
        Iterator<String> iterator = fruits.iterator();
        
        // Use the iterator to traverse through the LinkedList
        System.out.println("Using Iterator to traverse through the LinkedList:");
        while (iterator.hasNext()) {
            String fruit = iterator.next();
            System.out.println(fruit);
        }
        
        // Use a for-each loop to traverse through the LinkedList
        System.out.println("\nUsing for-each loop to traverse through the LinkedList:");
        for (String fruit : fruits) {
            System.out.println(fruit);
        }
        
        // Obtain a new iterator for the LinkedList
        iterator = fruits.iterator(); // Reset the iterator
        while (iterator.hasNext()) {
            String fruit = iterator.next();
            if (fruit.startsWith("B")) {
                iterator.remove(); // Remove elements that start with "B"
            }
        }
        
        // Display the LinkedList after removal of elements that start with 'B'
        System.out.println("\nLinkedList after removal of elements that start with 'B':");
        for (String fruit : fruits) {
            System.out.println(fruit);
        }
    }
}
import java.util.ArrayList;
import java.util.Iterator;

public class ArrayListIteratorExample {
    public static void main(String[] args) {
        // Create an ArrayList and add some fruit names
        ArrayList<String> fruits = new ArrayList<>();
        fruits.add("Apple");
        fruits.add("Banana");
        fruits.add("Cherry");
        
        // Obtain an iterator for the ArrayList
        Iterator<String> iterator = fruits.iterator();
        
        // Use the iterator to traverse through the ArrayList
        System.out.println("Using Iterator to traverse through the ArrayList:");
        while (iterator.hasNext()) {
            String fruit = iterator.next();
            System.out.println(fruit);
        }
        
        // Use a for-each loop to traverse through the ArrayList
        System.out.println("\nUsing for-each loop to traverse through the ArrayList:");
        for (String fruit : fruits) {
            System.out.println(fruit);
        }
        
        // Obtain a new iterator for the ArrayList
        iterator = fruits.iterator(); // Reset the iterator
        while (iterator.hasNext()) {
            String fruit = iterator.next();
            if (fruit.startsWith("B")) {
                iterator.remove(); // Remove elements that start with "B"
            }
        }
        
        // Display the ArrayList after removal of elements that start with 'B'
        System.out.println("\nArrayList after removal of elements that start with 'B':");
        for (String fruit : fruits) {
            System.out.println(fruit);
        }
    }
}
public class ReverseStringLambda {
    @FunctionalInterface
    interface StringReverser {
        String reverse(String str);
    }

    public static void main(String[] args) {
        // Lambda expression to reverse a string
        StringReverser reverser = (str) -> new StringBuilder(str).reverse().toString();
        
        String example = "Hello, World!";
        String reversed = reverser.reverse(example);
        
        // Print original and reversed strings
        System.out.println("Original: " + example);
        System.out.println("Reversed: " + reversed);
    }
}
@FunctionalInterface
interface PiValue {
    double getPi();
}

public class Main {
    public static void main(String[] args) {
        PiValue pi = () -> Math.PI;
        double p = pi.getPi();
        System.out.println("The value of Pi is: " + p);
    }
}
public class MagicBox<T> {
    private T item;

    public void addItem(T item) {
        this.item = item;
        System.out.println("Added item to the magic box: " + item);
    }

    public T getItem() {
        return item;
    }

    public void processBox(MagicBox<? super Integer> box) {
        System.out.println("Items in the box are processed [" + box.getItem() + "]");
    }

    public static void main(String[] args) {
        MagicBox<Integer> integerBox = new MagicBox<>();
        integerBox.addItem(43);
        
        MagicBox<String> stringBox = new MagicBox<>();
        stringBox.addItem("Sofiya");
        
        MagicBox<Boolean> booleanBox = new MagicBox<>();
        booleanBox.addItem(false);
        
        MagicBox<Object> objectBox = new MagicBox<>();
        objectBox.addItem(43.43);

        // Using processBox with a MagicBox that can accept Integer or its supertypes
        integerBox.processBox(integerBox);
        integerBox.processBox(objectBox);

        // The following lines will cause compilation errors as they don't match the processBox parameter type
        // integerBox.processBox(stringBox);
        // integerBox.processBox(booleanBox);
    }
}
public class BoundedArithmetic<T extends Number> {
    public double add(T a, T b) {
        return a.doubleValue() + b.doubleValue();
    }
    
    public double subtract(T a, T b) {
        return a.doubleValue() - b.doubleValue();
    }
    
    public double multiply(T a, T b) {
        return a.doubleValue() * b.doubleValue();
    }
    
    public double divide(T a, T b) {
        if (b.doubleValue() == 0) {
            throw new ArithmeticException("Division by zero is not allowed.");
        }
        return a.doubleValue() / b.doubleValue();
    }
    
    public static void main(String[] args) {
        BoundedArithmetic<Number> calculator = new BoundedArithmetic<>();
        Integer a = 10;
        Integer b = 5;
        System.out.println("Addition: " + calculator.add(a, b));
        System.out.println("Subtraction: " + calculator.subtract(a, b));
        System.out.println("Multiplication: " + calculator.multiply(a, b));
        System.out.println("Division: " + calculator.divide(a, b));
        
        Double x = 15.5;
        Double y = 4.5;
        System.out.println("Addition (Double): " + calculator.add(x, y));
        System.out.println("Subtraction (Double): " + calculator.subtract(x, y));
        System.out.println("Multiplication (Double): " + calculator.multiply(x, y));
        System.out.println("Division (Double): " + calculator.divide(x, y));
    }
}
criteria = "email:equals:"+vendor_email;
response = zoho.crm.searchRecords("users", criteria);
info response;
#include <stdio.h>
struct Banking_Account
{
 char name[32];
 int pin;
 float balance;
};
void print_banking_details(struct Banking_Account account);
int main(void)
{
 struct Banking_Account accounts[3];
 sprintf(accounts[0].name, "Steffan Hooper");
 accounts[0].pin = 7373;
 accounts[0].balance = 1250.0f;
 sprintf(accounts[1].name, "Xinyu Hu");
 accounts[1].pin = 1234;
 accounts[1].balance = 2150.0f;
 sprintf(accounts[2].name, "Jade Abbott");
 accounts[2].pin = 7777;
 accounts[2].balance = 2250.0f;
 print_banking_details(accounts[2]);
 printf("\n");
 print_banking_details(accounts[1]);
 printf("\n");
 print_banking_details(accounts[0]);
 printf("\n");
 return 0;
}
void print_banking_details(struct Banking_Account account)
{
 printf("Account Name: %s\n", account.name);
 printf("Account Balance: $%.2f\n", account.balance);
 printf("Account Pin: %d\n", account.pin);
}
@mixin width {
    width: auto !important;
}
table {
    &.table-fit {
        @include width;
        table-layout: auto !important;
        thead th,
        tbody td,
        tfoot th,
        tfoot td  {
            @include width;
        }
    }
}
table.table-fit {
  width: auto !important;
  table-layout: auto !important;
}
table.table-fit thead th,
table.table-fit tbody td,
table.table-fit tfoot th,
table.table-fit tfoot td {
  width: auto !important;
}
const mongoose = require('mongoose');

function validateEmail(email) {
    const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
    return emailRegex.test(email);
}

const userData = new mongoose.Schema({
    
    email: {
        type: 'string',
        required: true,
        validate:{
            validator: validateEmail,
            message: 'Please enter a valid email',
        }
    },
    password: {
        type: 'string',
        required: true
    }    


  });


  const saveuser = mongoose.model('users', userData);

  module.exports = saveuser;


const mongoose = require('mongoose');

function checkName(name){
    const nameRegex = /^[a-zA-Z]+$/;
    return  nameRegex.test(name);
}

const userDitails = new mongoose.Schema({

    user_id: {
        type: mongoose.Schema.Types.ObjectId,
        required: true
    },
    name: {
        type: 'string',
        required: true,
        validate:{
            validator: checkName,
            message: 'enter valid name'
        }
    },
    phone:{
        type: 'number',
    },
    country: {
        type: 'string',
        enum: ['usa','uk','india']
    },
    file:{
        type: 'string',
    }    

  });


  const saveUserDetails = mongoose.model('userDitails', userDitails);

  module.exports = saveUserDetails;

var jwt = require('jsonwebtoken');


function auth(req,res,next){

    const getToken = req.headers.authorization;

    if(!getToken){
        res.status(401).json({
            status: 'error',
            message: 'not found'
        })
    }

    const tokenCheck = getToken.split(' ');

    if(tokenCheck.length != 2 || tokenCheck[0] !== 'Bearer'){
     
        res.status(401).json({
            status: 'error',
            message: 'Invalid authorization'
        })
        
    }

    const token = tokenCheck[1];

    jwt.verify(token, 'shhhhh', function(err, decoded) {


        if(err){
            res.status(401).json({
                status: 'error',
                message: 'faild authorization'
            })
        }
        
        req.user = decoded;
        next();

      });



}


module.exports = auth;
var express = require('express');
var router = express.Router();
const multer  = require('multer')
const fs = require('fs')
const storage2 = require('node-persist');
const auth = require('../middleware/auth')
var jwt = require('jsonwebtoken');
const path = require('path');



const saveuser = require('../model/user');
const saveUserDetails = require('../model/userDetail');

const storage = multer.diskStorage({
  destination: function (req, file, cb) {
    cb(null, 'uploads/')
  },
  filename: function (req, file, cb) {
    cb(null, `${Date.now()}_${file.originalname}`)
  }
})

const upload = multer(
  { storage: storage }
)

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});


const saveUserData = async (req,res,next) =>{

  try {

    const saveUser = new saveuser({
      email: req.body.email,
      password: req.body.password
    })

    const users = await saveUser.save();

    const userID = users._id;

    const saveDetila = new saveUserDetails({
      user_id: userID,
      name: req.body.name,
      phone: req.body.phone,
      country: req.body.country,
      file: req.file.filename,
    })

    const detils = await saveDetila.save();


    res.status(200).json({
      status: 'success',
      users,
      detils

    })
    
  } catch (error) {
    if (req.file && req.file.path && fs.existsSync(req.file.path)) {
      fs.unlinkSync(req.file.path);
    }
    if(error.name === 'ValidationError'){
      if (req.file && req.file.path && fs.existsSync(req.file.path)) {
        fs.unlinkSync(req.file.path);
      }
      const validationError = {};
      for(const key in error.errors){
        validationError[key] = error.errors[key].message;
      }
      return res.status(400).json({
        error: validationError
      })
    }
    res.send(500).json({
      massage: 'Server Error'
    })

  }

}


const checkUser = async (req,res,next) => {

  try {

    const {email,password} = req.body

    const findUser = await saveuser.find({email: email});

    if(!findUser){
      res.send(201).json({
        status: 'error',
        message: 'Email is not Found'
      })
    }

    if(findUser){

      const passwordCheck = await saveuser.find({password: password});

      if(!passwordCheck){
        res.send(201).json({
          status: 'error',
          message: 'Wrong Password'
        })
      } else {

        const storeData = findUser.toString();
        await storage2.init('');
        await storage2.setItem(storeData,'user');
        var token = jwt.sign({ _id: findUser[0]._id }, 'shhhhh');

        res.status(200).json({
          status: 'success',
          message: 'login Successfully',
          token
        })

      }

    }

    
  } catch (error) {
     
    if(error) throw error;

    res.send(500).json({
      massage: 'Server Error'
    })
    
  }

}


const userList = async (req,res,next) => {
  try {

    const query = {};

    if(req.query.email){
      query.email = { $regex: new RegExp(req.query.email,'i')};
    }

    if(req.query.name){
      query.name = {$regex: new RegExp(req.query.name,'i')};
    }

    if(req.query.phone){
      query.phone = req.query.phone
    }

    if(req.query.country){
      req.query = {$regex: new RegExp(req.query.country,'i')};
    }

    const page = parseInt(req.query.page) || 1;
    const pageSize = parseInt(req.query.pageSize) || 5;

    const Listuser = await saveUserDetails.aggregate([
      {
        $match: query
      },
      {
        $lookup: {
          from: "users",
          localField: "user_id",
          foreignField: "_id",
          as: "user",
        },
      },
      {
        $skip: (page - 1) * pageSize,
      },
      {
        $limit: pageSize
      }
    ])

    res.status(200).json({
      status: 'success',
      Listuser
    });
    
  } catch (error) {
    
    res.send(500).json({
      massage: 'Server Error'
    })

  }
}

const updateUser = async (req, res, next) => {
  try {
    const userid = req.params.id;

    const getuserDetila = await saveUserDetails.findOne({ user_id: userid });

    if (!getuserDetila) {
      return res.status(400).json({
        status: 'error',
        message: 'User not found'
      });
    }

    if (getuserDetila.file) {
      const filePath = path.join('uploads/', getuserDetila.file);
      if (fs.existsSync(filePath)) {
        fs.unlinkSync(filePath);
      }
    }

    const userData = await saveuser.findByIdAndUpdate(
      userid,
      {
        email: req.body.email,
        password: req.body.password
      },
      { new: true }
    );

    const userDetails = await saveUserDetails.findOneAndUpdate(
      { user_id: userid },
      {
        name: req.body.name,
        phone: req.body.phone,
        country: req.body.country,
        file: req.file.filename,
      },
      {
        new: true
      }
    );

    res.status(200).json({
      status: 'Success',
      userData,
      userDetails,
    });
  } catch (error) {
    if (req.file && req.file.path && fs.existsSync(req.file.path)) {
      fs.unlinkSync(req.file.path);
    }
    console.error(error); // Log the actual error for debugging
    res.status(500).json({
      status: 'error',
      message: error.message // Send the actual error message
    });
  }
};


const deleteUser = async (req, res, next) => {
  try {
    const userid = req.params.id;

    const getUserDetails = await saveUserDetails.findOne({ user_id: userid });

    if (!getUserDetails) {
      return res.status(400).json({
        status: 'error',
        message: 'User not found'
      });
    }

    if (getUserDetails.file) {
      const filePath = path.join('uploads/', getUserDetails.file);
      if (fs.existsSync(filePath)) {
        fs.unlinkSync(filePath);
      }
    }

    await saveuser.findByIdAndDelete(userid);
    await saveUserDetails.findOneAndDelete({ user_id: userid });

    res.status(200).json({
      status: 'Success',
      message: 'User deleted successfully'
    });
  } catch (error) {
    console.error(error); // Log the actual error for debugging
    res.status(500).json({
      status: 'error',
      message: error.message // Send the actual error message
    });
  }
};







router.post('/createUser', upload.single('file'),saveUserData)
router.post('/loginUser', checkUser)
router.get('/getData', auth,userList)
router.put('/updateData/:id', auth,upload.single('file'),updateUser)

module.exports = router;
title: "count no.of 1's"
.model small
.stack 100h
.data
   num1 db 05
   count db dup(0)
.code
   mov ax,@data
       mov ds,ax
       xor ax,ax
   mov al,num1
   mov cx,08
   mov bl,0 
   again: rol al,1
          Jc noadd
          inc bl
   noadd:loop again
         mov count,bl
mov ah,4ch
   int 21h
   end
   
// C Program for Message Queue (Reader Process) 
#include <stdio.h> 
#include <sys/ipc.h> 
#include <sys/msg.h> 

// structure for message queue 
struct mesg_buffer { 
	long mesg_type; 
	char mesg_text[100]; 
} message; 

int main() 
{ 
	key_t key; 
	int msgid; 

	// ftok to generate unique key 
	key = ftok("progfile", 65); 

	// msgget creates a message queue 
	// and returns identifier 
	msgid = msgget(key, 0666 | IPC_CREAT); 

	// msgrcv to receive message 
	msgrcv(msgid, &message, sizeof(message), 1, 0); 

	// display the message 
	printf("Data Received is : %s \n", 
					message.mesg_text); 

	// to destroy the message queue 
	msgctl(msgid, IPC_RMID, NULL); 

	return 0; 
}
	// C Program for Message Queue (Writer Process) 
#include <stdio.h> 
#include <sys/ipc.h> 
#include <sys/msg.h> 
#define MAX 10 

// structure for message queue 
struct mesg_buffer { 
	long mesg_type; 
	char mesg_text[100]; 
} message; 

int main() 
{ 
	key_t key; 
	int msgid; 

	// ftok to generate unique key 
	key = ftok("progfile", 65); 

	// msgget creates a message queue 
	// and returns identifier 
	msgid = msgget(key, 0666 | IPC_CREAT); 
	message.mesg_type = 1; 

	printf("Write Data : "); 
	fgets(message.mesg_text,MAX,stdin); 

	// msgsnd to send message 
	msgsnd(msgid, &message, sizeof(message), 0); 

	// display the message 
	printf("Data send is : %s \n", message.mesg_text); 

	return 0; 
}
#include <stdio.h>
#include <unistd.h>
#include <string.h>

int main() {
    int fd[2]; // Array to hold the two ends of the pipe: fd[0] for reading, fd[1] for writing
    pid_t pid;
    char writeMessage[] = "Hello from parent process!";
    char readMessage[100];

    // Create the pipe
    if (pipe(fd) == -1) {
        perror("pipe failed");
        return 1;
    }

    // Fork a child process
    pid = fork();

    if (pid < 0) {
        perror("fork failed");
        return 1;
    } else if (pid > 0) {
        // Parent process
        close(fd[0]); // Close the reading end of the pipe in the parent

        // Write a message to the pipe
        write(fd[1], writeMessage, strlen(writeMessage) + 1);
        close(fd[1]); // Close the writing end of the pipe after writing

        // Wait for child process to finish
        wait(NULL);
    } else {
        // Child process
        close(fd[1]); // Close the writing end of the pipe in the child

        // Read the message from the pipe
        read(fd[0], readMessage, sizeof(readMessage));
        printf("Child process received: %s\n", readMessage);
        close(fd[0]); // Close the reading end of the pipe after reading
    }

return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>

#define FIFO_NAME "myfifo"

int main() {
    int fd;
    char *message = "Hello from writer process!";
    
    // Create the FIFO if it does not exist
    if (mkfifo(FIFO_NAME, 0666) == -1) {
        perror("mkfifo");
        exit(EXIT_FAILURE);
    }

    // Open the FIFO for writing
    fd = open(FIFO_NAME, O_WRONLY);
    if (fd == -1) {
        perror("open");
        exit(EXIT_FAILURE);
    }

    // Write the message to the FIFO
    if (write(fd, message, strlen(message) + 1) == -1) {
        perror("write");
        close(fd);
        exit(EXIT_FAILURE);
    }

    printf("Writer: Wrote message to FIFO.\n");
    
    // Close the FIFO
    close(fd);

    return 0;
}
#include <stdio.h>
#include <stdlib.h>
#define MAX_FRAMES 100
int isPageInFrame(int frames[], int n, int page) {
    for (int i = 0; i < n; i++) {
        if (frames[i] == page) {
            return 1;
        }
    }
    return 0;
}
void printFrames(int frames[], int n) {
    for (int i = 0; i < n; i++) {
        if (frames[i] == -1) {
            printf("-");
        } else {
            printf("%d", frames[i]);
        }
        if (i < n - 1) {
            printf(" ");
        }
    }
    printf("\n");
}
int main() {
    int n, numFrames;
    int pageFaults = 0;
    printf("Enter the number of frames: ");
    scanf("%d", &numFrames);
    int frames[MAX_FRAMES];
    for (int i = 0; i < numFrames; i++) {
        frames[i] = -1;
    }
    printf("Enter the number of page requests: ");
    scanf("%d", &n);
    int pageRequests[n];
    printf("Enter the page requests: ");
    for (int i = 0; i < n; i++) {
        scanf("%d", &pageRequests[i]);
    }
    int currentFrame = 0;
    for (int i = 0; i < n; i++) {
        int page = pageRequests[i];
        if (!isPageInFrame(frames, numFrames, page)) {
            pageFaults++;
            frames[currentFrame] = page;
            currentFrame = (currentFrame + 1) % numFrames;
        }
        printFrames(frames, numFrames);
    }
    printf("Total page faults: %d\n", pageFaults);
    return 0;
}
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>

int main() {
    // Generate unique key
    key_t key = ftok("shmfile", 65);
    if (key == -1) {
        perror("ftok");
        return 1;
    }

    // Get the shared memory segment
    int shmid = shmget(key, 1024, 0666 | IPC_CREAT);
    if (shmid == -1) {
        perror("shmget");
        return 1;
    }

    // Attach to the shared memory
    char *str = (char*)shmat(shmid, (void*)0, 0);
    if (str == (char*)(-1)) {
        perror("shmat");
        return 1;
    }

    // Read data from shared memory
    printf("Data read from memory: %s\n", str);

    // Detach from shared memory
    if (shmdt(str) == -1) {
        perror("shmdt");
        return 1;
    }

    // Destroy the shared memory
    if (shmctl(shmid, IPC_RMID, NULL) == -1) {
        perror("shmctl");
        return 1;
    }

    return 0;
}
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <string.h>

int main() {
    // Generate unique key
    key_t key = ftok("shmfile", 65);
    if (key == -1) {
        perror("ftok");
        return 1;
    }

    // Create shared memory segment
    int shmid = shmget(key, 1024, 0666 | IPC_CREAT);
    if (shmid == -1) {
        perror("shmget");
        return 1;
    }

    // Attach to shared memory
    char *str = (char*)shmat(shmid, (void*)0, 0);
    if (str == (char*)(-1)) {
        perror("shmat");
        return 1;
    }

    // Write data to shared memory
    printf("Write Data : ");
    fgets(str, 1024, stdin);
    // Remove the newline character added by fgets
    str[strcspn(str, "\n")] = 0;

    printf("Data written in memory: %s\n", str);

    // Detach from shared memory
    if (shmdt(str) == -1) {
        perror("shmdt");
        return 1;
    }

    return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>

int main() {
    int file;
    off_t offset;
    char buffer[20];

    // Open file
    file = open("file.txt", O_RDONLY);
    if (file == -1) {
        perror("Error opening file");
        exit(EXIT_FAILURE);
    }

    // Move file offset to 10 bytes from the beginning
    offset = lseek(file, 10, SEEK_SET);
    if (offset == -1) {
        perror("Error seeking in file");
        close(file);
        exit(EXIT_FAILURE);
    }

    // Read from the new offset
    if (read(file, buffer, 20) == -1) {
        perror("Error reading from file");
        close(file);
        exit(EXIT_FAILURE);
    }

    // Print the read content
    printf("Read content: %.*s\n", 20, buffer);

    // Close file
    close(file);

    return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>

int main() {
    DIR *dir;
    struct dirent *entry;

    // Open directory
    dir = opendir(".");
    if (dir == NULL) {
        perror("Error opening directory");
        exit(EXIT_FAILURE);
    }

    // Read directory entries
    while ((entry = readdir(dir)) != NULL) {
        printf("%s\n", entry->d_name);
    }

    // Close directory
    closedir(dir);

    return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>

int main() {
    struct stat fileStat;

    // Get file information
    if (stat("file.txt", &fileStat) == -1) {
        perror("Error getting file information");
        exit(EXIT_FAILURE);
    }

    // Print file information
    printf("File size: %ld bytes\n", fileStat.st_size);
    printf("File permissions: %o\n", fileStat.st_mode & 0777);
    printf("Last access time: %ld\n", fileStat.st_atime);

    return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>

#define BUFFER_SIZE 1024

int main() {
    int sourceFile, destFile;
    ssize_t bytesRead, bytesWritten;
    char buffer[BUFFER_SIZE];

    // Open source file
    sourceFile = open("source.txt", O_RDONLY);
    if (sourceFile == -1) {
        perror("Error opening source file");
        exit(EXIT_FAILURE);
    }

    // Open destination file
    destFile = open("dest.txt", O_WRONLY | O_CREAT | O_TRUNC, 0644);
    if (destFile == -1) {
        perror("Error opening destination file");
        close(sourceFile);
        exit(EXIT_FAILURE);
    }

    // Read from source and write to destination
    while ((bytesRead = read(sourceFile, buffer, BUFFER_SIZE)) > 0) {
        bytesWritten = write(destFile, buffer, bytesRead);
        if (bytesWritten != bytesRead) {
            perror("Error writing to destination file");
            close(sourceFile);
            close(destFile);
            exit(EXIT_FAILURE);
        }
    }

    if (bytesRead == -1) {
        perror("Error reading from source file");
    }

    // Close files
    close(sourceFile);
    close(destFile);

    return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>

int main() {
    int file;
    int flags;

    // Open file
    file = open("file.txt", O_RDWR);
    if (file == -1) {
        perror("Error opening file");
        exit(EXIT_FAILURE);
    }

    // Get file descriptor flags
    flags = fcntl(file, F_GETFL);
    if (flags == -1) {
        perror("Error getting file flags");
        close(file);
        exit(EXIT_FAILURE);
    }

    // Set file descriptor flags to append mode
    flags |= O_APPEND;
    if (fcntl(file, F_SETFL, flags) == -1) {
        perror("Error setting file flags");
        close(file);
        exit(EXIT_FAILURE);
    }

    // Write to file
    if (write(file, "Appending this line\n", 20) == -1) {
        perror("Error writing to file");
    }

    // Close file
    close(file);

    return 0;
}
#include<stdio.h>
 int main()
{
    int bt[20],p[20],wt[20],tat[20],i,j,n,total=0,pos,temp;
    float avg_wt,avg_tat;
    printf("Enter number of process:");
    scanf("%d",&n); 
    printf("nEnter Burst Time:n");
    for(i=0;i<n;i++)
    {
        printf("p%d:",i+1);
        scanf("%d",&bt[i]);
        p[i]=i+1;         
    }
    for(i=0;i<n;i++)
    {
        pos=i;
        for(j=i+1;j<n;j++)
        {
            if(bt[j]<bt[pos])
                pos=j;
        }
        temp=bt[i];
        bt[i]=bt[pos];
        bt[pos]=temp;
  
        temp=p[i];
        p[i]=p[pos];
        p[pos]=temp;
    }
    wt[0]=0;               
    for(i=1;i<n;i++)
    {
        wt[i]=0;
        for(j=0;j<i;j++)
            wt[i]+=bt[j];
        total+=wt[i];
    }
    avg_wt=(float)total/n;      
    total=0;
    printf("nProcesst    Burst Time    tWaiting TimetTurnaround Time");
    for(i=0;i<n;i++)
    {
        tat[i]=bt[i]+wt[i];   
        total+=tat[i];
        printf("np%dtt  %dtt    %dttt%d",p[i],bt[i],wt[i],tat[i]);
    }
    avg_tat=(float)total/n;    
    printf("nnAverage Waiting Time=%f",avg_wt);
    printf("nAverage Turnaround Time=%fn",avg_tat);
}








#include<stdio.h>
 int main()
{
int process,resource,instance,j,i,k=0,count1=0,count2=0;
int avail[10] , max[10][10], allot[10][10],need[10][10],completed[10];
printf("\n\t\t Enter No. of Process: "); 
scanf("%d",&process); 
printf("\n\t\tEnter No. of Resources: "); 
scanf("%d",&resource); 
for(i=0;i<process;i++)
completed[i]=0;
printf("\n\t Enter No. of Available Instances: ");
 for(i=0;i<resource;i++)
{
scanf("%d",&instance); 
avail[i]=instance;
}
printf("\n\tEnter Maximum No. of instances of resources that a Process need:\n");
for(i=0;i<process;i++)
{
printf("\n\t For P[%d]",i);
 for(j=0;j<resource;j++)
{
printf("\t"); 
scanf("%d",&instance); 
max[i][j]=instance;
}
}
printf("\n\t Enter no. of instances already allocated to process of a resource:\n");
for(i=0;i<process;i++)
{
printf("\n\t For P[%d]\t",i); 
for(j=0;j<resource;j++)
{
scanf("%d",&instance);
 allot[i][j]=instance;
need[i][j]=max[i][j]-allot[i][j];//calculating  Need  of  each process
		}	
}
printf("\n\n \t Safe Sequence is:- \t"); 
while(count1!=process)
{
count2=count1; 
for(i=0;i<process;i++)
{
for(j=0;j<resource;j++)
{
if(need[i][j]<=avail[j])
{
k++;
}
}
if(k==resource  &&  completed[i]==0  )
{
printf("P[%d]\t",i); 
completed[i]=1; 
for(j=0;j<resource;j++)
{
avail[j]=avail[j]+allot[i][j];
}
count1++;
}
			k=0;	
}
if(count1==count2)
{
printf("\t\t Stop ..After this.....Deadlock \n");
 break;
}
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
int n, k;
int t[(int)1e5 + 1];

int frogJump(vector<int>& a, int n, int k) {
    if (n == 1) return 0; // Starting point, no cost

    if (t[n] != -1) return t[n];

    int minCost = INT_MAX;
    for (int i = 1; i <= k; ++i) {
        if (n - i >= 1) {
            minCost = min(minCost, frogJump(a, n - i, k) + abs(a[n - 1] - a[n - i - 1]));
        }
    }
    t[n] = minCost % mod;
    return t[n];
}

int main() {
    memset(t, -1, sizeof(t));

    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }

    int result = frogJump(a, n, k);
    cout << result << endl;
    return 0;
}
#include <stdio.h>

#include <stdlib.h>

typedef struct {

    int base;

    int limit;

} Segment;

void simulateSegmentation(int segments[], int numSegments) {

    int memory[100];  // Simulate memory with an array (100 units for example)

    int currentBase = 0;

    // Allocate segments in memory

    for (int i = 0; i < numSegments; i++) {

        if (currentBase + segments[i] <= 100) {

            printf("Allocating segment %d with size %d at base %d\n", i, segments[i], currentBase);

            for (int j = currentBase; j < currentBase + segments[i]; j++) {

                memory[j] = 1;  // Mark memory as occupied

            }

            currentBase += segments[i];

        } else {

            printf("Not enough memory for segment %d with size %d\n", i, segments[i]);

        }

    }

}

int main() {

    int numSegments;

    printf("Enter number of segments: ");

    scanf("%d", &numSegments);

    int segments[numSegments];

    for (int i = 0; i < numSegments; i++) {

        printf("Enter size of segment %d: ", i);

        scanf("%d", &segments[i]);

    }

    simulateSegmentation(segments, numSegments);

    return 0;

}
#include <stdio.h>

#include <stdlib.h>

#define PAGE_SIZE 4  // Define page size (4KB for example)

#define MEMORY_SIZE 32  // Define memory size (32KB for example)

void simulatePaging(int processSize) {

    int numPages = (processSize + PAGE_SIZE - 1) / PAGE_SIZE;  // Calculate the number of pages required

    printf("Process of size %dKB requires %d pages.\n", processSize, numPages);

    int memory[MEMORY_SIZE / PAGE_SIZE];  // Simulate memory with an array

    // Initialize memory (0 means free, 1 means occupied)

    for (int i = 0; i < MEMORY_SIZE / PAGE_SIZE; i++) {

        memory[i] = 0;

    }

    // Allocate pages to the process

    for (int i = 0; i < numPages; i++) {

        for (int j = 0; j < MEMORY_SIZE / PAGE_SIZE; j++) {

            if (memory[j] == 0) {

                memory[j] = 1;

                printf("Allocating page %d to frame %d\n", i, j);

                break;

            }

        }

    }

}

int main() {

    int processSize;

    printf("Enter process size (in KB): ");

    scanf("%d", &processSize);

    simulatePaging(processSize);

    return 0;

}
package org.example;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


public class Avaliacao {

    private Cliente cliente;
    private Funcionario funcionario;

    private int idade;
    private double peso;
    private String sexo;
    private String data;
    private double altura;
    private double massaMuscular;
    private double imc;
    private double percentualGordura;

    public Avaliacao(Cliente cliente, Funcionario funcionario, int idade, double peso, String sexo, String data, double altura) {
        this.cliente = cliente;
        this.funcionario = funcionario;
        this.idade = idade;
        this.peso = peso;
        this.sexo = sexo;
        this.data = data;
        this.altura = altura;

    }


    //getters e setters
    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    public Funcionario getFuncionario() {
        return funcionario;
    }

    public void setFuncionario(Funcionario funcionario) {
        this.funcionario = funcionario;
    }

    public int getIdade() {
        return idade;
    }

    public void setIdade(int idade) {
        this.idade = idade;
    }

    public double getPeso() {
        return peso;
    }

    public void setPeso(double peso) {
        this.peso = peso;
    }

    public String getSexo() {
        return sexo;
    }

    public void setSexo(String sexo) {
        this.sexo = sexo;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public double getAltura() {
        return altura;
    }

    public void setAltura(double altura) {
        this.altura = altura;
    }

    public double getMassaMuscular() {
        return massaMuscular;
    }

    public void setMassaMuscular(double massaMuscular) {
        this.massaMuscular = massaMuscular;
    }

    public double getImc() {
        return imc;
    }

    public void setImc(double imc) {
        this.imc = imc;
    }

    public double getPercentualGordura() {
        return percentualGordura;
    }

    public void setPercentualGordura(double percentualGordura) {
        this.percentualGordura = percentualGordura;
    }


    //metodos


    // Método para converter a data de String para Date
    public Date getDataAsDate() throws ParseException {
        SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
        return formatter.parse(this.data);
    }

    //metodo calcular  IMC

    private double calcularIMC() {

        return peso / (altura * altura);
    }


    //metodo calcular massa muscular (forma simplificada)

    private double calcularMassaMuscular() {
        return peso * (1 - percentualGordura / 100);
    }

    //metodo calcular % de gordura (formula simplificada)

    private double calcularPercentualGordura() {
        //  usando IMC, idade e sexo (simplificado)

        double fatorSexo = sexo.equalsIgnoreCase("masculino") ? 10.8 : 0;

        return (1.2 * imc) + (0.23 * idade) - fatorSexo - 5.4;

    }


    public void atualizarCalculos() {
        this.imc = calcularIMC();
        this.massaMuscular = calcularMassaMuscular();
        this.percentualGordura = calcularPercentualGordura();
    }


    @Override
    public String toString() {
        return "=================" +
                "\n cliente=" + cliente +
                "\n funcionario=" + funcionario +
                "\n idade=" + idade +
                "\n peso=" + peso +
                "\n sexo='" + sexo + '\'' +
                "\n data='" + data + '\'' +
                "\n altura=" + altura +
                "\n massaMuscular=" + massaMuscular +
                "\n imc=" + imc +
                "\n percentualGordura=" + percentualGordura;
    }
}
#include <stdio.h>
#include <stdbool.h>
#define P 5
#define R 3
int available[R], max[P][R], allocation[P][R], need[P][R];
void calculate_need() {
    for (int i = 0; i < P; i++)
        for (int j = 0; j < R; j++)
            need[i][j] = max[i][j] - allocation[i][j];
}
bool is_safe(int safe_seq[]) {
    int work[R];
    bool finish[P] = {0};
    for (int i = 0; i < R; i++) work[i] = available[i];
    int count = 0;
    while (count < P) {
        bool found = false;
        for (int p = 0; p < P; p++) {
            if (!finish[p]) {
                int j;
                for (j = 0; j < R; j++)
                    if (need[p][j] > work[j]) break;
                if (j == R) {
                    for (int k = 0; k < R; k++) work[k] += allocation[p][k];
                    finish[p] = true;
                    safe_seq[count++] = p;
                    found = true;
                }
            }
        }
        if (!found) return false;
    }
    return true;
}
void input_data() {
    printf("Enter available resources: ");
    for (int i = 0; i < R; i++) scanf("%d", &available[i]);
    printf("Enter maximum demand:\n");
    for (int i = 0; i < P; i++) for (int j = 0; j < R; j++) scanf("%d", &max[i][j]);
    printf("Enter allocated resources:\n");
    for (int i = 0; i < P; i++) for (int j = 0; j < R; j++) scanf("%d", &allocation[i][j]);
}
int main() {
    input_data();
    calculate_need();
    int safe_seq[P];
    if (is_safe(safe_seq)) {
        printf("System is in a safe state.\nSafe sequence is: ");
        for (int i = 0; i < P; i++) printf("%d ", safe_seq[i]);
        printf("\n");
    } else {
        printf("System is not in a safe state.\n");
    }
    return 0;
}
star

Fri Jun 07 2024 13:54:41 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 13:20:36 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 13:19:38 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 13:19:29 GMT+0000 (Coordinated Universal Time)

@exam

star

Fri Jun 07 2024 13:18:27 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 13:16:51 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 13:13:50 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Fri Jun 07 2024 12:56:59 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Fri Jun 07 2024 12:53:28 GMT+0000 (Coordinated Universal Time)

@signup

star

Fri Jun 07 2024 12:52:09 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 12:45:22 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 12:44:47 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 12:38:52 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 12:35:28 GMT+0000 (Coordinated Universal Time)

@signup

star

Fri Jun 07 2024 12:34:59 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 12:22:52 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 12:20:07 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 12:07:31 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 12:05:36 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 12:02:16 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 11:55:13 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 11:32:25 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge

star

Fri Jun 07 2024 11:27:55 GMT+0000 (Coordinated Universal Time)

@meanaspotato #c

star

Fri Jun 07 2024 10:29:12 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/31184000/making-a-bootstrap-table-column-fit-to-content

@xsirlalo #css

star

Fri Jun 07 2024 10:29:10 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/31184000/making-a-bootstrap-table-column-fit-to-content

@xsirlalo #css

star

Fri Jun 07 2024 08:48:16 GMT+0000 (Coordinated Universal Time) https://github.com/octocat/Hello-World

@calazar23

star

Fri Jun 07 2024 08:30:13 GMT+0000 (Coordinated Universal Time) https://www.dappfort.com/bybit-clone-script/

@novamichelin #ruby #nodejs #json #react.js #css

star

Fri Jun 07 2024 08:10:23 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Fri Jun 07 2024 08:09:41 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Fri Jun 07 2024 08:09:01 GMT+0000 (Coordinated Universal Time)

@sid_balar

star

Fri Jun 07 2024 06:09:21 GMT+0000 (Coordinated Universal Time)

@signup

star

Fri Jun 07 2024 04:58:50 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:58:22 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:57:31 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:56:58 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:56:22 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:54:34 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:53:54 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:52:04 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:51:37 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:50:56 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:50:13 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:49:24 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:47:25 GMT+0000 (Coordinated Universal Time)

@prabhas

star

Fri Jun 07 2024 04:38:30 GMT+0000 (Coordinated Universal Time)

@exam123

star

Fri Jun 07 2024 04:10:57 GMT+0000 (Coordinated Universal Time) https://atcoder.jp/contests/dp/submissions/54289370

@devdutt

star

Fri Jun 07 2024 03:25:40 GMT+0000 (Coordinated Universal Time)

@dbms

star

Fri Jun 07 2024 03:25:10 GMT+0000 (Coordinated Universal Time)

@dbms

star

Thu Jun 06 2024 23:54:22 GMT+0000 (Coordinated Universal Time)

@gabriellesoares

star

Thu Jun 06 2024 20:54:04 GMT+0000 (Coordinated Universal Time)

@prabhas

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension