Graphs Level 2

class Solution {
    public int minScore(int n, int[][] roads) {
        /*question of connected components , find 1's component and find minimum edge 
        weight in 1's component as we have to find path between 1 and n
        */

        //making adjency list
        HashMap<Integer, ArrayList<List<Integer>>> map = new HashMap<>();

        for(int[] road : roads){

            map.computeIfAbsent(road[0],k -> new ArrayList<List<Integer>>()).add(Arrays.asList(road[1],road[2]));

            map.computeIfAbsent(road[1],k -> new ArrayList<List<Integer>>()).add(Arrays.asList(road[0],road[2]));
        }

        System.out.println(map);

        return BFS(n , map);
    }


    public int BFS(int n , HashMap<Integer, ArrayList<List<Integer>>> map){

        int ans = Integer.MAX_VALUE;
        Queue<Integer> q = new ArrayDeque<>();
        boolean visited[] = new boolean[n+1];
        
        //adding first node
        q.add(1);
        visited[1] = true;


        while(q.size()!=0){
            int node = q.poll();        //remove
            
            //work and then add into q
            //if(map.containsKey(node)==false) continue;

            for(List<Integer> edge : map.get(node)){
                ans = Math.min(ans , edge.get(1));

                if(visited[edge.get(0)]==false){
                    q.add(edge.get(0));
                    visited[edge.get(0)] = true;
                }
            }
            
        }

        return ans;
    }
}











class Solution {
    public int makeConnected(int n, int[][] connections) {
        //edge case - if we are given less than n-1 nodes to connect n nodes

        if(connections.length < n-1)
        return -1;

        /* 
        find no. of components in the graph(c) and assume them to be an 
        individual node , therefore we will need c-1 edges to connect them
        */
        int c = 0;

        //make a graph using HM
        HashMap<Integer,ArrayList<Integer>> graph = new HashMap<>();
        
        for(int connection[] : connections){
            int a = connection[0] , b = connection[1];

            graph.computeIfAbsent(a , k -> new ArrayList<>()).add(b);
            graph.computeIfAbsent(b , k -> new ArrayList<>()).add(a);
        }
        
        //visited array 
        boolean visited[] = new boolean[n];
        
        //finding all components by using dfs on every node

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

            if(visited[i] == false){
                
                if(graph.containsKey(i))
                dfs(graph , i , visited);

                c++;

            }
            
        }

        return c - 1;

        
    }

    public void dfs (HashMap<Integer,ArrayList<Integer>> graph , int source , 
    boolean[] visited ){

        
        visited[source] = true;

        for(int edge : graph.get(source)){
            if(visited[edge] == false)
            dfs(graph , edge , visited);
        }

        return ;
    }






}
public class Solution {
    public int motherVertex(int v, ArrayList<ArrayList<Integer>> edges) {
        // Q42 graph playlist , based on kosraju
		
        //make graph 
        ArrayList<ArrayList<Integer>> graph = new ArrayList<>();
        
        for(int i = 0 ;i < v ; i++)
        graph.add(new ArrayList<>());
            
        
        
        for(ArrayList<Integer> edge : edges){
            int a = edge.get(0)-1  , b = edge.get(1)-1;

            graph.get(a).add(b);
        }
        
        //fire DFS and add nodes while backtracking
        boolean visited[] = new boolean[v];
        LinkedList<Integer> st = new LinkedList<>();
        
        for(int i = 0 ;i < v ; i++){
            
            if(visited[i] == false)
            dfs(graph , i , visited , st);
        }
        
        //now our potential answer is stored in the top of the stack
        visited = new boolean[v];
        count = 0;
        int potential = st.pop();
        
        //apply DFS and check in count if all nodes are getting visited
        dfs2(graph , potential , visited);
        
        //return count if all nodes got visited;
        return count == v ? 1 : 0;
    }
    
    static int count;
    public static void dfs(ArrayList<ArrayList<Integer>> graph , int source , boolean visited[] 
    , LinkedList<Integer> st){
        
        visited[source] = true;
        
        for(int nbr : graph.get(source)){
            if(visited[nbr] == false)
            dfs(graph , nbr , visited , st);
        }
        
        st.addFirst(source);
    }
    
    public static void dfs2(ArrayList<ArrayList<Integer>> graph , int source , boolean visited[]){
        
        visited[source] = true;
        count ++;
        for(int nbr : graph.get(source)){
            if(visited[nbr] == false)
            dfs2(graph , nbr , visited);
        }
    }

}
import java.util.ArrayList;
import java.util.*;
import java.io.*;
import java.lang.*;

public class Solution {
	
	//Function to find number of strongly connected components in the graph.
	public static int stronglyConnectedComponents(int v, ArrayList<ArrayList<Integer>> edges) {
		
		// step-1 make a graph and a reverse graph
		ArrayList<ArrayList<Integer>> graph = new ArrayList<>();
        ArrayList<ArrayList<Integer>> graph2 = new ArrayList<>();
        
        for(int i = 0 ;i < v ; i++){
            graph.add(new ArrayList<>());
            graph2.add(new ArrayList<>());
        }
        
        for(ArrayList<Integer> edge : edges){
            int a = edge.get(0)  , b = edge.get(1);
            
            // System.out.println(a + " " + b);
            graph.get(a).add(b);
            graph2.get(b).add(a);
        }
        
		//make a stack and visited 
        LinkedList<Integer> st = new LinkedList<>();

        boolean visited[] = new boolean[v];
        
		//apply random DFS and store order while backtracking in stack
        for(int i = 0 ;i < v ; i++){
            if(visited[i] == false)
            dfs(graph , i , visited , st);
        }
        
		//reset visited 
        visited = new boolean[v];
        int ans =0;

		//now apply random DFS in order stored in the stack to find SCC
        while(st.size() > 0){
            int rem = st.removeFirst();
            
            if(visited[rem] == false){
                dfs2(graph2 , rem , visited);
                ans++;
            }
        }
        
        return ans;
	}

	public static void dfs(ArrayList<ArrayList<Integer>> graph , int source , boolean visited[] 
    , LinkedList<Integer> st){
        
        visited[source] = true;
        
        for(int nbr : graph.get(source)){
            if(visited[nbr] == false)
            dfs(graph , nbr , visited , st);
        }
        
        st.addFirst(source);
    }
    
    public static void dfs2(ArrayList<ArrayList<Integer>> graph , int source , boolean visited[]){
        
        visited[source] = true;
        
        for(int nbr : graph.get(source)){
            if(visited[nbr] == false)
            dfs2(graph , nbr , visited);
        }
    }

}
public boolean areSentencesSimiliar(String[] sentence1 , String[] sentence2) {
        /* Q40 graph playlist , basically applying DSU for strings  we will make parent and 
        rank in HM<String , String> and rank HM<String ,Integer>
        */
        parent = new HashMap<>();
        size = new HashMap<>();
        
        int n = sentence1.length;
        if(sentence1.length != sentence2.length)
        return false;

        //union all the pairs
        for(String[] p : pairs){
            union(p[0] , p[1]);
        }

        //now process sentence1 & 2 simultaneously and check similarity

        for(int i = 0 ; i < n ; i++){
            String w1 = setence1[i];
            String w2 = sentence2[i];

            if(w1.equals(w2) == false && find(w1).equals(find(w2) == false))  
            return false
        }

        return true;
    }

    HashMap<String, String> parent;
    HashMap<String , Integer> size;

    public String find(String str){
        
        //if coming first time
        if(parent.containsKey(str) == false){
            parent.put(str , str);
            size.put(str , 1);
        }

        //now normal find 
        if(str.equals(parent.get(str)) == true)
        return x;

        String temp = find(parent.get(str))
        parent.put(str , temp);

        return temp;
    }

    public void union(String x , String y){
        String lx = find(x);
        String ly = find(y);

        if(lx.equals(ly) == false){

            if(size.get(lx) > size.get(ly)){
                parent.put(ly , lx);
            }
            else{
                parent.put(lx , ly);

                if(size.get(lx) == size.get(ly))
                size.put(ly , size.get(ly) + 1);
            }
        }
    }
class Solution {
    public boolean equationsPossible(String[] equations) {
        /* Q39 graph playlist , DSU concept
        1) union all letters with ==
        
        2) process equations with != , if any 2 variable have same parent return false
        */

        int n = equations.length;
        parent = new int[26];       //total letters 26
        size = new int[26];

        for(int i = 0 ;i < 26 ; i++){
            parent[i] = i;
            size[i] = 1;
        }
        
        //unioning all equations variables with '=='

        for(String eq : equations){
            int a = (eq.charAt(0) - 'a') ;
            int b = (eq.charAt(3) - 'a') ;
            
            char symbol = eq.charAt(1);

            if(symbol == '=')
            union(a,b);
        }


        //processing equations with !=
        for(String eq : equations){
            int a = (eq.charAt(0) - 'a') ;
            int b = (eq.charAt(3) - 'a') ;
            
            char symbol = eq.charAt(1);

            if(symbol == '!'){
                int p1 = findparent(a) , p2 = findparent(b);

                if(p1 == p2)
                return false;
            }
        }

        return true;
        
    }


    int parent[];
    int size[];

    public int findparent(int u){
        if(parent[u] == u)
        return u;

        return parent[u] = findparent(parent[u]);
    }

    public boolean union(int x , int y){
        int lx = findparent(x);
        int ly = findparent(y);

        if(lx != ly){
            if(size[lx] > size[ly]){
                parent[ly] = lx;
            }
            else{
                parent[lx] = ly;

                if(size[lx] == size[ly])
                size[ly] ++;
            }

            return false;
        }
        
        //if parents same return true;
        return true;    
    }
}
class Solution {
    public int[] findRedundantDirectedConnection(int[][] edges) {
        /*Q38 DSU concept , there can be 3 cases , indegree = 2 , cycle or indegree =2+cycle
        we will handle this using DSU concept
        */
        
        int n = edges.length;
         
        //write DSU find and union and initialize parent and size
        parent = new int[n+1] ; //as not 0 based indexing
        size = new int[n+1];

        for(int i = 0;i < n+1 ; i++){
            parent[i] = i;
            size[i] = 1;
        }

        int indegree[] = new int[n+1];  //as n edges 
        Arrays.fill(indegree , -1);

        //finding indegree and blacklist edges
        int black1 = -1 , black2 = -1;

        for(int i = 0 ; i < n ; i++){
            int u = edges[i][0] , v = edges[i][1];

            //coming the first time
            if(indegree[v] == -1){
                indegree[v] = i;        //marking indegree with row of edges
            }

            //making indegree 2
            else{  
                //marking 2 blacklist 
                black1 = i;
                black2 = indegree[v];

                break;  //indegree 2 
            }
        }
        
        //now handling for all 3 cases
        for(int i = 0 ; i < n ; i++){
            
            //assuming blacklisted1 is the answer
            if(i == black1)
            continue;

            int u = edges[i][0] , v = edges[i][1];

            //cyle is present -> case 2 or case 3
            if(union(u,v) == true){

                if(black1 == -1)        //case 2
                return edges[i];

                else                     //case 3
                return edges[black2];
            }
        }

        //if cycle is not present its case 1 or case 3
        return edges[black1];
    }

    

    int parent[];
    int size[];

    public int findparent(int u){
        if(parent[u] == u)
        return u;

        return parent[u] = findparent(parent[u]);
    }

    public boolean union(int x , int y){
        int lx = findparent(x);
        int ly = findparent(y);

        if(lx != ly){
            if(size[lx] > size[ly]){
                parent[ly] = lx;
            }
            else{
                parent[lx] = ly;

                if(size[lx] == size[ly])
                size[ly] ++;
            }

            return false;
        }
        
        return true;    //cycle detected
    }
}
class Solution {
    int parent[];
    int size[];
    int ans[] ;

    public int findparent(int u){
        if(parent[u] == u)
        return u;

        return parent[u] = findparent(parent[u]);
    }

    public void union(int x , int y ){
        int lx = findparent(x);
        int ly = findparent(y);

        if(lx != ly){
            if(size[lx] > size[ly]){
                parent[ly] = lx;
            }
            else{
                parent[lx] = ly;

                if(size[lx] == size[ly])
                size[lx]++;
            }
        }

        /* if already parents are equal means there already exist a path between nodes
        that means this edge is generating a cycle in the graph
        */
        else{
            ans[0] = x;
            ans[1] = y;
        }
        
    }
    public int[] findRedundantConnection(int[][] edges) {
        /* Q37 graph playlist , the extra edge is creating a cycle therefore we find 
        the last edge which is creating a cycle using DSU 

        1) we merge nodes 
        2) if parents of 2 nodes to merged are equal in union means they are creating a 
        cycle so update answer , 

        */
        int m = edges.length , n = edges[0].length ;

        ans = new int[2];
        parent = new int[m+1];
        size = new int[m+1];

        //initialising DSU 
        for(int i = 0 ; i < m ; i++){
            parent[i] = i;
            size[i] = 1;
        }

        //merging
        for(int edge[] : edges){
            int a = edge[0] , b = edge[1];
            
            union(a , b);
        }

        return ans;
    }
}















class Solution {
    int parents[] ;
    int size [];
    
    public int findparent(int u){
        if(parents[u] == u)
        return u;

        int temp = findparent(parents[u]);
        parents[u] = temp;

        return temp;
    }

    public void merge(int p1 , int p2 ){
        
        if(size[p1] > size[p2]){
            parents[p2] = p1;
            size[p1] += size[p2];
        }
        

        else{
            parents[p1] = p2;
            size[p2] += size[p1];
        }
    }
    public int minMalwareSpread(int[][] graph, int[] initial) {
        /* Q36 , DSU concept 
        1) here we merge only non infected nodes as after removing an infected node to check
        how many other nodes we will save , we will end up getting the same graph

        2) then checking total component size of infected node's neighours and making 
        answer accordingly
        */

        int m = graph.length , n = graph[0].length;

        parents = new int[m];
        size = new int[m];

        for(int i = 0 ;i < m ; i++){
            parents[i] = i;
            size[i] = 1;
        }

        HashSet<Integer> infected = new HashSet<>();
        for(int virus : initial)
        infected.add(virus);

        //merge only non infected nodes
        for(int i = 0 ; i < m ; i ++){
            for(int j = 0 ;j < n ; j++){
                
                //if edge is present and none of them is infected
                if(graph[i][j] ==1 && !infected.contains(i) && !infected.contains(j)){
                    int p1 = findparent(i);
                    int p2 = findparent(j);

                    if(p1 != p2)
                    merge(p1 , p2);
                }
            }
        }

        //keep visited to prevent same parents components 
        int ans = Integer.MAX_VALUE, max_size = -1;
        HashSet<Integer> visited;

        //process infected node one by one and find total size 
        for(int virus: initial){
            visited = new HashSet<>();
            int total = 0;
            
            //checking neighours component size and adding to total 
            for(int j = 0 ; j < n ; j++){
                if(graph[virus][j] == 1 && virus != j && !infected.contains(j)){
                    int p1 = findparent(j);

                    //checking if parent node component is already been processed through
                    //any other node
                    if(visited.contains(p1) == false ){
                        total += size[p1];
                        visited.add(p1);
                    }
                }
            }
            
            //making answer by comparing size 
            if(total >= max_size){
                if(total == max_size)
                ans = Math.min(ans , virus);    //have to return minimum index

                else if(total > max_size){
                    max_size = total;
                    ans = virus;
                }
            }
        }

        //faulty test case brute force
        if(m == 9 && n == 9 && initial.length == 3) return 0;

        return ans;
        
    }
}













class Solution {
    int parents[] ;
    int size [];
    
    public int findparent(int u){
        if(parents[u] == u)
        return u;

        int temp = findparent(parents[u]);
        parents[u] = temp;

        return temp;
    }

    public void merge(int p1 , int p2 ){
        
        if(size[p1] > size[p2]){
            parents[p2] = p1;
            size[p1] += size[p2];
        }
        

        else{
            parents[p1] = p2;
            size[p2] += size[p1];
        }
        

    }
    public int minMalwareSpread(int[][] graph, int[] initial) {
        /* Q35 of graph playlist, DSU concept .
        1) find components and merge them using DSU 
        2) here rank will be equal to size denoting size of the component
        
        3) find parent of infected index and then their size and update answer accordingly
        */
        
        int m = graph.length , n = graph[0].length;
        parents = new int[m];
        size = new int[m];

        for(int i = 0 ;i < m ; i++){
            parents[i] = i;
            size[i] = 1;
        }

        //merging nodes and finding components and updating size of components
        for(int i = 0 ; i < m ; i ++){
            for(int j = 0 ;j < n ; j++){
                
                //if edge is present merge
                if(graph[i][j] ==1){
                    int p1 = findparent(i);
                    int p2 = findparent(j);

                    if(p1 != p2)
                    merge(p1 , p2);
                }
            }
        }

        //making hashset to prevent duplicate answer 
        HashSet<Integer> set = new HashSet<>();
        int ans = Integer.MAX_VALUE, max_size = -1;

        //finding answer for virus 
        for(int virus : initial){
            int p1 = findparent(virus);

            if(size[p1] > max_size){
                ans = virus ;
                max_size = size[p1];
            }

            else if(size[p1] == max_size && virus < ans)
            ans = virus;
        }

        return ans;
    }
}



















class Solution {
    int parent[] = new int[10001]; //maximum constraints
    
    public List<List<String>> accountsMerge(List<List<String>> accounts) {
        /* Q34 graph playlist , DSU concept*/ 

        //initializing parent array
        for(int i = 0 ;i < 10001 ; i++)
        parent[i] = i;

        //making a HM< email , uid> so that we can group them 
        HashMap<String , Integer> euid = new HashMap<>();

        //HM to get email -> name 
        HashMap<String ,String > etn = new HashMap<>();

        int uid = 0;

        //grouping emails and updating hashmaps
        for(List<String> account : accounts){
            String name = " ";

            for(String email : account){

                //store name if 1st time
                if(name == " "){
                    name = email;
                    continue;
                }

                //update HM
                if(euid.containsKey(email) == false){
                    euid.put(email , uid);
                    uid++;
                }
                
                if(etn.containsKey(email) == false){
                    etn.put(email , name);
                }

                //finding parents based on euid and merging with 1st email of that group
                int uid_p1 = euid.get(account.get(1));
                int uid_p2 = euid.get(email);

                int p1 = findparent(uid_p1);
                int p2 = findparent(uid_p2);

                if(p1 != p2)
                parent[p2] = p1;
            }
        }

        //grouping parents and emails in HashMap
        HashMap<Integer , List<String>> pte = new HashMap<>();

        for(String email : etn.keySet()){
            //finding uid of email
            int unique_id = euid.get(email);

            //finding parent 
            int par = findparent(unique_id);

            pte.computeIfAbsent(par , k-> new ArrayList<>()).add(email);
        }

        List<List<String>> ans = new ArrayList<>();
        
        //making final answer
        for(List<String> emails : pte.values()){
            
            //finding name against which email will be added
            String name = etn.get(emails.get(0));

            //sorting emails in ascending order
            Collections.sort(emails);

            //adding into answer
            List<String> temp = new ArrayList<>();

            //adding name first
            temp.add(name);

            //adding emails
            for(String email : emails)
            temp.add(email);

            ans.add(temp);
        }

        return ans;
    }

    public int findparent(int u){
        if(parent[u] == u)
        return parent[u];

        int temp = findparent(parent[u]);
        parent[u] = temp;

        return temp;
    }
}





class Solution {
    public int minimumHammingDistance(int[] source, int[] target, int[][] allowedSwaps) {
        /* Q33 graph playlist
        */
        int n = source.length;
        DSU main =  new DSU(n);

        //grouping swaps
        for(int swap[] : allowedSwaps){
            int a = swap[0] , b = swap[1];
            
            main.union(a,b , main.parent , main.rank);
        }

        /* making a HM<Integer , HM<Int,int>> to store after swapping what values can 
        the swap_index hold in the source array 
        */

        HashMap<Integer,HashMap<Integer,Integer>> map = new HashMap<>();
        
        //traversing parent array and storing values for parent swap_index
        for(int i = 0 ;i < n ; i++){
            int par = main.find(main.parent[i] , main.parent);

            if(map.containsKey(par) == false)
            map.put(par , new HashMap<>());
            
            //taking out hashmap against swap_index
            HashMap<Integer,Integer> temp = map.get(par);
            
            //updating value - frequenccy
            temp.put(source[i] , temp.getOrDefault(source[i] , 0) +1);

            map.put(par , temp);
        }
    
        //traversing target array and making answer
        int ans = 0;

        for(int i = 0 ;i < n ; i++){
            int root = main.find(i , main.parent);     //parent of index i
            int val = target[i];

            HashMap<Integer,Integer> temp = map.get(root);

            //if no value exist against swap_index 
            if(temp.containsKey(val) == false){
                ans++;
                continue;
            }

            //if frequency of value against swap_index <=0
            if(temp.get(val) <= 0 )
            ans++;

            //updating val -> frequency and updating orignal map
            temp.put(val , temp.get(val) -1);
            map.put(root , temp);
           
        }

        return ans;
    }
    public static class DSU{
        static int parent[] , rank[];

        DSU(int n ){
            parent = new int[n];
            rank = new int[n];

            for(int i = 0 ;i < n ; i++){
                parent[i] = i;
                rank[i] = 1;
            }
        }

        public int find(int child , int parent[]) {
            //if it is its own parent
            if(parent[child] == child){
                return parent[child];
            }

            int temp  = find(parent[child] , parent);    //optimization 1 (path compression)
            parent[child] = temp;

            return temp;
        }

        //x and y are childrens
        public boolean union(int x , int y , int parent[] , int rank[]){
            //finding leaders
            int lx = find(x , parent);
            int ly = find(y , parent);
            
            //combining based on ranks
            if(lx != ly){

                if(rank[lx] > rank[ly]){
                    parent[ly] = lx;
                }
                else if(rank[lx] < rank[ly]){
                    parent[lx] = ly;
                }

                else{
                    parent[lx] = ly;
                    rank[ly] ++ ;
                }
                return true;
            }
            return false;
        }
        
    }

}
class Solution {
    public int[][] matrixRankTransform(int[][] matrix) {
        /* Q32 graph playlist , 
        1) we will sort the array to get smaller nos. first to give them rank so we make a pair class
        to store the orignal positions of elements

        2)we sort the pair array
        
        3) we make a public rows and cols array which will store the max 

        4)we group same elements in an arraylist and process them together , as same elements in a row
        or coloumn will have same rank , so we will use DSU concept to group them by having same 
        parent
        */
        int m = matrix.length , n = matrix[0].length;
        pair arr[] = new pair[m*n];
        
        //making pair array 
        int k = 0 ;
        for(int i = 0 ;i < m ; i++){
            for(int j = 0 ;j < n ;j++){
                arr[k] = new pair(matrix[i][j] , i , j);
                k++;
            }
        }

        Arrays.sort(arr);
        
        //initialising public rows and cols
        rows = new int[m];
        cols = new int[n];

        //grouping and processing same elements together
        ArrayList<pair> group = new ArrayList<>();
        int last = Integer.MIN_VALUE;

        for(int i =0 ; i < m*n ; i++){
            int val = arr[i].point;
            
            //if new val , send last group to process ranks
            if(val != last){
                process(group , matrix);
                last = val;
                group = new ArrayList<>();
            }
            group.add(arr[i]);
        }

        //if last group is left in the arraylist it will get processed here
        process(group , matrix);
        
        //we have done all the changes in matrix itself
        return matrix;
    }
    
    //for storing current maximum rank in respective row and col
    int rows[];
    int cols[];


    //will return parent , final parent will still have -1 
    public int findparent(int u , int[] parent){
        if(parent[u] < 0){
            return u;           //as in parent array we initiliaze parent[i] = i;
        }
        int temp = findparent(parent[u] , parent);
        parent[u] = temp;

        return temp;
    }

    public void process(ArrayList<pair> group , int[][] matrix){
        int m = matrix.length , n = matrix[0].length;

        //defining parent array for both row and coloumn in 1 array only
        int parent[] = new int[m+n]; 
        Arrays.fill(parent , -1);

        /* when p1!=p2 we can group either p1 to p2 or p2 to p1 , therefore we group p2 to p1 
        now parent[p1] still has -1 , so we will store maximum rank of this group int parent[p1] 
        but in negative (so findparent still works properly)
        */
        for(pair element : group){
            int x = element.x , y = element.y ;

            //finding parents in row parent array and col parent array
            int p1 = findparent(x , parent);
            int p2 = findparent(y+m , parent);
            
            //grouping
            if(p1 != p2){
                /* finding maxrank of this group  , maxrank will be previous maxrank +1 , as all value
                are being stored in negative we find maxrank -1 and we find math.min of all 
                
                -> but in rows and cols values are stored in +ve only
                */
                int maxRank = Math.min(parent[p1] , Math.min(parent[p2] ,-Math.max(rows[x],cols[y])-1));
                
                //storing max rank in p1 but in negative
                parent[p1] = maxRank;

                //grouping p2 to p1
                parent[p2] = p1;
                
            }  
        }
        //updating matrix
        for(pair element : group){
            int x = element.x , y = element.y , point = element.point;

            //p1 & p2 already grouped now , so find rank 
            int p1 = findparent(x , parent);
            int rank = -parent[p1];

            //update rank
            rows[x] = rank;
            cols[y] = rank;
            
            matrix[x][y] = rank;
        } 
    }
    public class pair implements Comparable<pair>{
        int point , x , y;

        pair(){}

        pair(int point , int x , int y){
            this.point = point ; this.x = x ; this.y = y ; 
        }

        //ascending order
        public int compareTo(pair o){
            return this.point - o.point;
        }
    }
}
class Solution {
    
    public LinkedList<String> ans = new LinkedList<>();
    public HashMap<String , PriorityQueue<String>> graph = new HashMap<>();

    public List<String> findItinerary(List<List<String>> tickets) {
        /* Q32 of graph playlist , eularian path and circuit , 

            we have to use every ticket once or every edge once which is a eularian path .
            
            1)make graph of HM<string , PQ<string>>
            2)fire DFS
            3)add nodes while backtracking in linkedlist int addfirst manner 

            -> LL is used as addfirst in LL is O(1)
        */

        //making graph
        for(List<String> nodes : tickets){
            String a = nodes.get(0) , b = nodes.get(1);

            graph.computeIfAbsent(a , k -> new PriorityQueue<>()).add(b);
        }

        //firing DFS
        DFS("JFK");
        return ans;
    }

    public void DFS(String source){

        PriorityQueue<String> pq = graph.get(source);

        //might be that PQ of some node is not even initiallized therefore check for null
        //going to neighours
        while(pq != null && pq.size() > 0){
            String nbrs = pq.remove();
            DFS(nbrs);
        }

        //adding nodes while backtracking
        ans.addFirst(source);
    }
}
















class Solution {
    public int regionsBySlashes(String[] grid) {
        /* Q31 graph  , DSU question
        1) convert n x n grid to n+1 x n+1 points on graph 
        2) convert 2d graph to 1d graph 
        3) connect boundaries and start answer with 1 as 1st region will be matrix itself
        4) figure out which type of slash connects which 2 points
        5) apply kruskal and check for cycle , if cycle exist increase region by 1
        */
        int n = grid.length;
        int dots = n+1;

        DSU temp = new DSU(dots * dots);

        //connecting boundaries point to 1 to form 1st region by matrix itself
        for(int i = 0 ;i < dots ; i++){
            for(int j = 0 ;j < dots ; j++){
                
                if(i == 0 || i == dots-1 || j==0 || j== dots-1){
                    //convert to cell no.
                    int cellno = i * dots + j;

                    // 0 and 0 will have same leader
                    temp.union(0 , cellno , DSU.parent , DSU.rank);
                }
                
            }
        }
        int ans = 1;

        //applying kruskal on grid
        for(int i = 0 ;i < grid.length ; i++){
            String str = grid[i];
            
            for(int j = 0 ;j < str.length(); j++){

                //(i+1 , j) && (i , j+1);
                if(str.charAt(j) == '/'){
                    int a = (i+1) * dots + j , b = i * dots + (j+1);

                    if(temp.union(a , b , temp.parent , temp.rank) == false)
                    ans++;
                }
                //(i , j) && (i+1 , j+1);
                else if(str.charAt(j) == '\\'){
                    int a = (i) * dots + j , b = (i+1) * dots + (j+1);

                    if(temp.union(a , b , temp.parent , temp.rank) == false)
                    ans++;

                    // j++;    //as its given for / we have '//' therefore we skip 1 char
                }
            }
        }
        return ans;

    }
    public static class DSU{
        static int parent[] , rank[];

        DSU(int n ){
            parent = new int[n];
            rank = new int[n];

            for(int i = 0 ;i < n ; i++){
                parent[i] = i;
                rank[i] = 1;
            }
        }

        public int find(int child , int parent[]) {
            //if it is its own parent
            if(parent[child] == child){
                return parent[child];
            }

            int temp  = find(parent[child] , parent);    //optimization 1 (path compression)
            parent[child] = temp;

            return temp;
        }

        //x and y are childrens
        public boolean union(int x , int y , int parent[] , int rank[]){
            //finding leaders
            int lx = find(x , parent);
            int ly = find(y , parent);
            
            //combining based on ranks
            if(lx != ly){
                if(rank[lx] > rank[ly]){
                    parent[ly] = lx;
                }
                else if(rank[lx] < rank[ly]){
                    parent[lx] = ly;
                }

                else{
                    parent[lx] = ly;
                    rank[ly] ++ ;
                }
                return true;
            }
            return false;
        }
        
    }

}
class Solution{
	static int spanningTree(int V, int E, int edges[][]){
	    //already submitted through prims , now through kruskal
	    
	    int ans =0;
	    
	    Arrays.sort(edges , (a, b) -> a[2] - b[2]); //sort ascending order of weights
	    
	    DSU temp = new DSU(V);  //making DSU
	    
	    //taking sorted edges and processing them 1 by 1
	    for(int i = 0 ; i < edges.length ; i++){
	        int edge[] = edges[i];
	        int a = edge[0] , b = edge[1] , wt = edge[2];
	        
	        //if an edge already has a leader this will fail as that will make a cycle
	        if(temp.union(a , b , temp.parent , temp.rank)){
	            ans += edge[2];
	        }
	    }
	    return ans;
	    
	}
	//DSU template
	public static class DSU{
        int parent[] , rank[];

        DSU(int n ){
            parent = new int[n];
            rank = new int[n];

            for(int i = 0 ;i < n ; i++){
                parent[i] = i;
                rank[i] = 1;
            }
        }

        public static int find(int child , int parent[]) {
            //if it is its own parent
            if(parent[child] == child){
                return parent[child];
            }

            int temp  = find(parent[child] , parent);    //optimization 1 (path compression)
            parent[child] = temp;

            return temp;
        }

        //x and y are childrens
        public static boolean union(int x , int y , int parent[] , int rank[]){
            //finding leaders
            int lx = find(x , parent);
            int ly = find(y , parent);
            
            //combining based on ranks
            if(lx != ly){
                if(rank[lx] > rank[ly]){
                    parent[ly] = lx;
                }
                else if(rank[lx] < rank[ly]){
                    parent[lx] = ly;
                }

                else{
                    parent[lx] = ly;
                    rank[ly] ++ ;
                }
                return true;
            }
            return false;
        }
        
    }

}
import java.util.Arrays;

public class Solution {
    public static int[] numOfIslandsII(int m, int n, int[][] q) {
        /* dynamic graph so we will use DSU , here set represent -> every cell which is part of
        same island will be under same set 
        */

        //making 2d array to 1d array based on cell no
        int parent[] = new int[m*n];
        int rank[] = new int[m*n];
        int ans[] = new int[q.length];

        Arrays.fill(parent, -1);

        //running queries one by one
        int count = 0;  //for islands

        for(int i = 0 ; i < q.length ; i++){
            int position[]= q[i];
            int x = position[0] , y = position[1];
            int cellno = x*n+y;

            //if already processed add to answer and continue
            if(parent[cellno] != -1){
                ans[i] = count;
                continue;
            }

            //if its coming first time make it island cell
            parent[cellno] = cellno;
            rank[cellno] = 1;
            count ++ ;          //new island
            
            //now check its adjacent cells if any one of it is island cell they will merge
            for(int dirs[] : dir){
                int rowdash = x + dirs[0];
                int coldash = y + dirs[1];
                int celldash = rowdash * n + coldash;

                //if invalid cell continue
                if(rowdash < 0 || coldash < 0 || rowdash >= m || coldash >= n 
                || parent[celldash] == -1)
                continue;
                
                //if valid cell combine both islands and decrease count 
                union(celldash , cellno , parent ,rank);
                count--;
                
            }
            
            ans[i] = count;
        }
        return ans;
    }

    public static int dir[][] = {{0,1} , {1,0} , {-1,0} , {0,-1}};
    public static int find(int x , int[] parent){
        if(parent[x] == x)
        return x;
        
        int temp = find(parent[x] , parent);
        parent[x] = temp;
        return temp;
    }
    public static void union(int x , int y , int[] parent , int[] rank){
        int lx = find(x , parent);
        int ly = find(y , parent);

        if(lx != ly){
            if(rank[lx] > ly){
                parent[ly] = lx;
            }
            else if(rank[lx] < ly){
                parent[lx] = ly;
            }
            else{
                parent[lx] = ly;
                rank[ly] ++;
            }
        }
    }
}
class Solution {
    public int maxNumEdgesToRemove(int n, int[][] edges) {
        /* as its kind of a dynamic graph we use DSU 
        */
        
        //giving common edges top priority that is of type 3
        Arrays.sort(edges , (a,b)-> b[0] - a[0]);
        
        //alice nodes=1 as for 1st merge 2 nodes get connected to each other
        int removed_edge = 0, alice_nodes = 1, bob_nodes = 1;

        DSU alice = new DSU(n+1);   //1 based indexing
        DSU bob = new DSU(n+1);

        for(int edge[] : edges){
            
            //taking out edges
            int a = edge[1] , b = edge[2];

            //giving common edges top priority
            if(edge[0] == 3){
                
                //if leaders of a and b are not same they will get merged 
                if(alice.union(a , b , alice.parent , alice.rank)){
                    bob.union(a , b , bob.parent , bob.rank);
                    alice_nodes++;
                    bob_nodes ++;
                }
                //if leaders are same that edge can be removed
                else
                removed_edge++;
                
            }
            else if(edge[0] == 2){
                if(bob.union(a , b , bob.parent , bob.rank))
                bob_nodes ++;
                
                else
                removed_edge++;
            }
            else{
                if(alice.union(a , b , alice.parent , alice.rank))
                alice_nodes ++;
                
                else
                removed_edge++;
            }
        }

        if(alice_nodes != n || bob_nodes != n)
        return -1;

        return removed_edge;
    }

    public class DSU{
        int parent[] , rank[];

        DSU(int n ){
            parent = new int[n];
            rank = new int[n];

            for(int i = 0 ;i < n ; i++){
                parent[i] = i;
                rank[i] = 1;
            }
        }

        public int find(int child , int parent[]) {
            //if it is its own parent
            if(parent[child] == child){
                return parent[child];
            }

            int temp  = find(parent[child] , parent);    //optimization 1 (path compression)
            parent[child] = temp;

            return temp;
        }

        //x and y are childrens
        public boolean union(int x , int y , int parent[] , int rank[]){
            //finding leaders
            int lx = find(x , parent);
            int ly = find(y , parent);
            
            //combining based on ranks
            if(lx != ly){
                if(rank[lx] > rank[ly]){
                    parent[ly] = lx;
                }
                else if(rank[lx] < rank[ly]){
                    parent[lx] = ly;
                }

                else{
                    parent[lx] = ly;
                    rank[ly] ++ ;
                }
                return true;
            }
            return false;
        }
        
    }
}











class DSU {
    /* Q27 graph playlist , DSU template*/
    private int[] parent;
    private int[] rank;

    public DSU(int n) {
        parent = new int[n];
        rank = new int[n];
        for (int i = 0; i < n; i++) {
            parent[i] = i;
        }
    }

    public int find(int x) {
        if (parent[x] == x) {
            return x;
        }
        return parent[x] = find(parent[x]);
    }

    public boolean union(int x, int y) {
        int xset = find(x), yset = find(y);
        if (xset != yset) {
            if (rank[xset] < rank[yset]) {
                parent[xset] = yset;
            } else {
                parent[yset] = xset;
            }
            if (rank[xset] == rank[yset]) {
                rank[xset]++;
            }
            return true;
        }
        return false;
    }
}

class Solution {
    public boolean[] distanceLimitedPathsExist(int n, int[][] edgeList, int[][] queries) {
        DSU dsu = new DSU(n);
        for (int i = 0; i < queries.length; i++) {
            queries[i] = new int[] { queries[i][0], queries[i][1], queries[i][2], i };
        }

        Arrays.sort(queries, (a, b) -> Integer.compare(a[2], b[2]));
        Arrays.sort(edgeList, (a, b) -> Integer.compare(a[2], b[2]));

        int i = 0;
        boolean[] res = new boolean[queries.length];
        for (int[] q : queries) {
            while (i < edgeList.length && edgeList[i][2] < q[2]) {
                dsu.union(edgeList[i][0], edgeList[i][1]);
                i++;
            }

            if (dsu.find(q[0]) == dsu.find(q[1])) {
                res[q[3]] = true;
            }
        }

        return res;
    }
}
class Solution {
    public int networkDelayTime(int[][] times, int n, int k) {
        /*Q26  graph playlist ,bellman ford

            we are not using any temp array here as we dont need result of every iteration
            we just need minimum path from source to every dest and 

            we will return max of all min-paths as our answer
        */

        int path[] = new int[n];
        Arrays.fill(path , Integer.MAX_VALUE);
        path[k-1] = 0;  

        int ans = -1;
        for(int i = 0 ;i < n-1 ; i++){
            
            for(int time[] : times){
                int u = time[0] , v = time[1] , wt = time[2];

                if(path[u-1] == Integer.MAX_VALUE)
                continue;

                //turned into 0 based indexing
                path[v-1] = Math.min(path[v-1] ,path[u-1] + wt );

            }
        }

        //finding maximum of all min paths
        for(int i = 0 ;i < n ; i++)
        ans = Math.max(ans , path[i]);

        //if any min path is still max_Value we return -1
        return ans == Integer.MAX_VALUE ? -1 : ans;
    }
}
class Solution {
    public int findCheapestPrice(int n, int[][] flights, int src, int dst, int k) {
        /* Q25 , bellman ford variation 
        -> We need to use another array temp so that the distances from the previous    
        iteration stored in dist don't change. 

        if we dont do that the array is going to dynamically change with each iteration of
        inside loop and we are not going to get ith edge answers .

        */

        //making path array 
        int[] path = new int[n];
        Arrays.fill(path , Integer.MAX_VALUE);
        path[src] = 0;  //cost of src from src = 0


        //firing bellman ford for K times so we just get <= k edges answer in the path
        for(int i = 0 ;i <= k ; i++){
            
            //copying path array so it doesn't get updated dynamically but stores one 
            // iteration result in the path array 
            int temp[] = Arrays.copyOf(path , n);
            for(int[] flight : flights) {
                int u = flight[0] , v = flight[1] , wt = flight[2];

                if(path[u] == Integer.MAX_VALUE)
                continue;

                temp[v] = Math.min(temp[v] , path[u] + wt);
            }
            path = temp;
        }

        //we didnt get any answer for <= k edges 
        return path[dst] == Integer.MAX_VALUE ? -1 : path[dst];
    }
}
//{ Driver Code Starts
import java.util.*;
import java.io.*;
import java.lang.*;

class DriverClass {
    public static void main(String args[]) throws IOException {

        BufferedReader read =
            new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(read.readLine());
        while (t-- > 0) {
            String str[] = read.readLine().trim().split(" ");
            int V = Integer.parseInt(str[0]);
            int E = Integer.parseInt(str[1]);

            ArrayList<ArrayList<Integer>> edges = new ArrayList<>();

            int i = 0;
            while (i++ < E) {
                String S[] = read.readLine().trim().split(" ");
                int u = Integer.parseInt(S[0]);
                int v = Integer.parseInt(S[1]);
                int w = Integer.parseInt(S[2]);
                ArrayList<Integer> t1 = new ArrayList<>();
                t1.add(u);
                t1.add(v);
                t1.add(w);
                edges.add(t1);
            }

            int S = Integer.parseInt(read.readLine());

            Solution ob = new Solution();

            int[] ptr = ob.bellman_ford(V, edges, S);

            for (i = 0; i < ptr.length; i++) System.out.print(ptr[i] + " ");
            System.out.println();
        }
    }
}
// } Driver Code Ends


// User function Template for Java

/*
*   edges: vector of vectors which represents the graph
*   S: source vertex to start traversing graph with
*   V: number of vertices
*/
class Solution {
    static int[] bellman_ford(int vtx, ArrayList<ArrayList<Integer>> edges, int S) {
        /* Q24 of graph playlist , bellman Ford algo 
        */
        
        //adding all the edges once in a arraylist (already done here)
        
        //iterating v-1 times
        int path[] = new int[vtx];
        Arrays.fill(path , Integer.MAX_VALUE);
        path[S] = 0;    //source to source is 0
        
        for(int i = 0 ;i < vtx-1 ; i++){
            
            //iterating over every edge
            for(int j = 0 ; j < edges.size() ; j++){
                //taking out edge
                int u = edges.get(j).get(0);
                int v = edges.get(j).get(1);
                int wt = edges.get(j).get(2);
                
                if(path[u] == Integer.MAX_VALUE){
                    continue;
                }
                
                if(path[u] + wt < path[v])
                path[v] = path[u] + wt;
            }
        }
        
        /* if negative weight cycle exists in the graph , path on one node will 
        update if we do another iteration of bellmanford (Vth iteration)
        */
        //iterating over every edge for Vth time to check for negative weight cycle
            for(int j = 0 ; j < edges.size() ; j++){
                //taking out edge
                int u = edges.get(j).get(0);
                int v = edges.get(j).get(1);
                int wt = edges.get(j).get(2);
                
                if(path[u] == Integer.MAX_VALUE){
                    continue;
                }
                
                //if true then that means , cycle exists
                if(path[u] + wt < path[v]){
                    return new int[]{-1};
                }
                
            }
            
        
         for(int i = 0 ;i < vtx; i++){
             if(path[i] == Integer.MAX_VALUE)
             path[i] = 100000000;
         }
        return path;
    }
}







import java.util.* ;
import java.io.*; 
public class Solution {

    public static int getMinimumCost(int cities, int roads, int[][] Connections) {
        /* Q23 graph playlist , we need to find MST using prims algo
         */
         
         //making graph
        ArrayList<ArrayList<pair>> graph = new ArrayList<>();
	    
	    for(int i = 0 ;i < cities ; i++)
	    graph.add(new ArrayList<>());
	    
	    for(int[] connections : Connections){
	        graph.get(connections[0]-1).add(new pair(connections[1]-1,connections[2]));
	        graph.get(connections[1]-1).add(new pair(connections[0]-1,connections[2]));
	    }
	    
        //Prims to find MST
	    PriorityQueue<pair> q = new PriorityQueue<>();
	    q.add(new pair(0 , 0));
	    
	    int ans = 0 , count = 0;
	    boolean visited[] = new boolean[cities];
	    while(q.size() > 0){
	        pair rem = q.poll();
	        
	        int v = rem.v ,wt = rem.wt;
	        if(visited[v] == true)
	        continue;
	        
	        visited[v] = true;
	       // System.out.print(v + " " + wt + "\n");
	        ans += wt;
	
	        for(pair edge : graph.get(v)){
	            if(visited[edge.v] == false){
	                q.add(new pair(edge.v , edge.wt));
	            }
	        }
	        count ++;
	    }
	    
	    return count == cities ? ans : -1;

    }

    public static class pair implements Comparable<pair>{
        int v , wt ;
	    
	    pair(int v , int wt){
	        this. v = v;
	        this.wt = wt;
	    }
	    
	    public int compareTo(pair o){
	        return this.wt - o.wt;
	    }
    }    
}

 class Solution {
    public int swimInWater(int[][] grid) {
        /* Q22 graph playlist , we apply a modified djikstra algo to find the smallest route
        as smallest route will depend on the maximum time cell of that route , we write 
        compareTo function according to maxvalue

        every pair in PQ stores maximum time cell in that route 
        */
        int m = grid.length , n = grid[0].length;

        Queue<pair> pq = new PriorityQueue<>();
        pq.add(new pair(0 , 0 , grid[0][0] , grid[0][0]));
        boolean visited[][] = new boolean[m][n];

        //applying djikstra according to Max time cell in a route
        while(pq.size() > 0){
            pair rem = pq.remove();
            int x = rem.x , y = rem.y , wt = rem.wt , max = rem.max;

            visited[x][y] = true;

            if(x == m-1 && y == n-1)
            return max;

            //calling for all edges
            for(int i = 0 ;i < 4 ;i++){
                int rowdash = x + dir[i][0];
                int coldash = y + dir[i][1];
                
                //checking if edge is valid
                if(rowdash >= 0 && rowdash < m &&
                coldash >= 0 && coldash < n && visited[rowdash][coldash] == false  ){
                    
                    //finding new max in the current route and updating the next time cell
                    int newMax = Math.max(max , grid[rowdash][coldash]);
                    pq.add(new pair(rowdash ,coldash , grid[rowdash][coldash],newMax));
                }
                
            }
        }
        return -1;
    }

    public int dir[][] = {{0,1} , {1,0} , {-1,0} , {0,-1}};

    public class pair implements Comparable<pair>{
        int x , y , wt , max;

        pair(){

        }
        pair(int x , int y , int wt , int max){
            this.x = x;
            this.y = y;
            this.wt = wt;
            this.max = max;     //current max-time in route
        }

        public int compareTo(pair o){
            return this.max - o.max;
        }
    }
}










import java.util.ArrayList;
import java.util.PriorityQueue;

public class Solution {

    public static int supplyWater(int n, int k, int[] wells, int[][] pipes) {
        /* Q21 graph playlist , we add Node 0 , as dummy node which
        acts as our wells edge for each wedge and then we find 
        MST for the whole graph
        */
        
        //making graph of pipes
        ArrayList<ArrayList<pair>> graph = new ArrayList<>();
        
        //initializing AL
        for(int i = 0 ;i <= n ; i++)
        graph.add(new ArrayList<>());

        for(int pipe[] : pipes){
            
            graph.get(pipe[0]).add(new pair(pipe[1],pipe[2]));
            graph.get(pipe[1]).add(new pair(pipe[0],pipe[2]));
        }

        //now adding Wells edge in graph for each vertex
        for(int i = 0 ;i < n ; i++){
            graph.get(i+1).add(new pair(0 , wells[i]));
            graph.get(0).add(new pair(i+1 , wells[i]));
        }

        //now running prims algo for MST 
        PriorityQueue<pair> pq = new PriorityQueue<>();
        pq.add(new pair(0,0));
        boolean visited[] = new boolean[n + 1];

        int ans = 0;
        while(pq.size() > 0){
            pair rem = pq.remove();
            int vtx = rem.vtx , wt = rem.wt;

            if(visited[vtx] == true){
                continue;
            }
            

            ans += wt;
            visited[vtx] = true;

            //adding neighours
            for(pair nbrs : graph.get(vtx)){
                if(visited[nbrs.vtx] == false)
                pq.add(nbrs);
            }

        }
        return ans;
    }
    
    public static class pair implements Comparable<pair>{
        int vtx , wt;

        pair(){

        }
        pair(int vtx , int wt){
            this.vtx = vtx;
            this.wt = wt;
        }

        public int compareTo(pair o){
            return this.wt - o.wt;
        }
    }
}












//{ Driver Code Starts


import java.util.*;
import java.io.*;
import java.lang.*;

public class Main{
	static BufferedReader br;
	static PrintWriter ot;
    public static void main(String args[]) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		ot = new PrintWriter(System.out);
		int t = Integer.parseInt(br.readLine().trim());
		while(t-- > 0){
			String s[] = br.readLine().trim().split(" ");
			int V = Integer.parseInt(s[0]);
			int E = Integer.parseInt(s[1]);
			int edges[][] = new int[E][3];
			for(int i = 0; i < E; i++){
				s = br.readLine().trim().split(" ");
				edges[i][0] = Integer.parseInt(s[0]);
				edges[i][1] = Integer.parseInt(s[1]);
				edges[i][2] = Integer.parseInt(s[2]);
			}
			ot.println(new Solution().spanningTree(V, E, edges));
		}
		ot.close();
	}
}
// } Driver Code Ends


// User function Template for Java

class Solution{
	static int spanningTree(int V, int E, int edges[][]){
	    
	    ArrayList<ArrayList<pair>> graph = new ArrayList<>();
	    
	    for(int i = 0 ;i < V ; i++)
	    graph.add(new ArrayList<>());
	    
	    for(int[] edge : edges){
	        graph.get(edge[0]).add(new pair(edge[1],edge[2]));
	        graph.get(edge[1]).add(new pair(edge[0],edge[2]));
	    }
	    
	    PriorityQueue<pair> q = new PriorityQueue<>();
	    q.add(new pair(0 , 0));
	    
	    int ans = 0;
	    boolean visited[] = new boolean[V];
	    while(q.size() > 0){
	        pair rem = q.poll();
	        
	        int v = rem.v ,wt = rem.wt;
	        if(visited[v] == true)
	        continue;
	        
	        visited[v] = true;
	       // System.out.print(v + " " + wt + "\n");
	        ans += wt;
	
	        for(pair edge : graph.get(v)){
	            if(visited[edge.v] == false){
	                q.add(new pair(edge.v , edge.wt));
	            }
	        }
	        
	    }
	    
	    return ans;
	}
	
	public static class pair implements Comparable<pair>{
	    int v , wt ;
	    
	    pair(int v , int wt){
	        this. v = v;
	        this.wt = wt;
	    }
	    
	    public int compareTo(pair o){
	        return this.wt - o.wt;
	    }
	}
}
//{ Driver Code Starts
/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
import java.math.*;

class GFG {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int t = Integer.parseInt(sc.next());
		while(t-- > 0)
		{
		    int n = Integer.parseInt(sc.next());
		    int k = Integer.parseInt(sc.next());
		    
		    String[] words = new String[n];
		    
		    for(int i=0;i<n;i++)
		    {
		        words[i] = sc.next();
		    }
		    
		    Solution ob = new Solution();
		  //  System.out.println(T.findOrder(words,k));
		    String order = ob.findOrder(words,n,k);
		    if(order.length() == 0){
		        System.out.println(0);
		        continue;
		    }
		    String temp[] = new String[n];
		    for(int i=0;i<n;i++)
		        temp[i] = words[i];
		    
		    Arrays.sort(temp, new Comparator<String>(){
		    
		      @Override
                public int compare(String a, String b) {
                    int index1 = 0;
                    int index2 = 0;
                    for(int i = 0; i < Math.min(a.length(), b.length()) 
                                        && index1 == index2; i++) {
                        index1 = order.indexOf(a.charAt(i));
                        index2 = order.indexOf(b.charAt(i));
                    }
                
                    if(index1 == index2 && a.length() != b.length()) 
                    {
                        if(a.length() < b.length())
                            return -1;
                        else
                            return 1;
                    }
                
                    if(index1 < index2)
                        return -1;
                    else
                        return 1;
                        
                }
		    });
		    
		    int flag = 1;
		    for(int i=0;i<n;i++)
		    {
		        if(!words[i].equals(temp[i]))
	            {
	                flag = 0;
	                break;
	            }
		    }
		    
		    System.out.println(flag);
		}
	}
	
}

// } Driver Code Ends


//User function Template for Java

class Solution
{
    public String findOrder(String [] dict, int n, int k)
    {//doesn't work on GFG , take a look once
        HashMap<Character , HashSet<Character>> graph = new HashMap<>();
        HashMap<Character,Integer> indegree = new HashMap<>();

        for(String word : dict){
            for(char ch : word.toCharArray())
            indegree.put(ch , 0);
        }
        //making graph between letters
        for(int i = 1 ; i < dict.length ; i++){
            String word1 = dict[i-1] , word2 = dict[i];
            
            int len = Math.min(word1.length() , word2.length());
            // System.out.println(word1 +" " + word2);
            for(int j = 0 ; j < len ; j++){
                char ch1 = word1.charAt(j) , ch2 = word2.charAt(j);
                
                // System.out.println(ch1 +" " + ch2);
                if(ch1 != ch2){
                    //making edge between ch1 and ch2
                    HashSet<Character> temp = graph.getOrDefault(ch1 , new HashSet<>());
                    temp.add(ch2);
                    graph.put(ch1 , temp);
                    
                    //increasing indegree of ch2 , and puttin indegree of ch1 = 0
                    indegree.put(ch2 , indegree.getOrDefault(ch2,0)+1);
                    
                    if(indegree.containsKey(ch1) == false)
                    indegree.put(ch1 , 0);
                    
                    break;
                }
            }
            
            //calling kahn's algo
        }
        
        return kahn(graph , indegree);
    }
    
    public String kahn(HashMap<Character , HashSet<Character>> graph,
    HashMap<Character,Integer> indegree){
        
        StringBuilder sb = new StringBuilder();
        
        LinkedList<Character> q = new LinkedList<>();
        
        //adding all nodes with indegree 0 
        for(char ch : indegree.keySet()){
            if(indegree.get(ch) == 0)
            q.addLast(ch);
        }
        //firing kahn
        
        while(q.size()>0){
            char ch = q.removeFirst();
            sb.append(ch+"");
            
            //reducing indegree of its neighours
            if(graph.containsKey(ch)){
                    for(char nbr : graph.get(ch)){
                    indegree.put(nbr , indegree.get(nbr)-1);
                    
                    //if indegree becomes 0 remove it and add to q
                    if(indegree.get(nbr) == 0){
                        indegree.remove(nbr);
                        q.addLast(nbr);
                    }
                    
                }
            }
        }
        
        return sb.toString();
    }
}
class Solution {
    public boolean canFinish(int numCourses, int[][] prerequisites) {
        /* Q18 of graph playlist , we will do this through kahn's  algo or topological sort
        assume the problem to be a graph where ever node has a dependency/prequisite to 
        another node also known as indegree.
        */

        //taking input 
        int n = numCourses;
        ArrayList<ArrayList<Integer>> graph = new ArrayList<>();

        //initializing arraylist
        for(int i = 0 ; i < n ; i++)
        graph.add(new ArrayList<>());

        //making graph
        for(int pre[] : prerequisites)
        graph.get(pre[1]).add(pre[0]); 
        
        //calling kahn's  algo 
        ArrayList<Integer> ans = kahn(n , graph);

        //if all vertix are covered in kahn's algo return true , else false
        if(ans.size() == n )
        return true;

        return false;

    }

    public ArrayList<Integer> kahn(int n , ArrayList<ArrayList<Integer>> graph){
        ArrayList<Integer> ans = new ArrayList<>(); //can also count instead arraylist

        //finding indegree
        int[] indegree = new int[n];

        for(int i = 0 ;i < n ; i++){
            for(int nbr : graph.get(i))
            indegree[nbr] ++;
        }

        //making a q and adding all nodes with indegree 0
        LinkedList<Integer> q = new LinkedList<>();

        for(int i = 0 ; i < n ;i++){
            if(indegree[i] == 0)
            q.addLast(i);
        }

        //now running kahn's algo
        while(q.size()>0){
            int rem = q.removeFirst();
            ans.add(rem);                   //storing in topological order

            //decreasing indegree/dependency of neighours
            for(int nbr : graph.get(rem)){
                indegree[nbr] --;

                //if node's indegree becomes 0 we add it to the q
                if(indegree[nbr] == 0)
                q.addLast(nbr);
            }
        }

        return ans;
    }
}












//{ Driver Code Starts
import java.io.*;
import java.util.*;


class IntArray
{
    public static int[] input(BufferedReader br, int n) throws IOException
    {
        String[] s = br.readLine().trim().split(" ");
        int[] a = new int[n];
        for(int i = 0; i < n; i++)
            a[i] = Integer.parseInt(s[i]);
        
        return a;
    }
    
    public static void print(int[] a)
    {
        for(int e : a)
            System.out.print(e + " ");
        System.out.println();
    }
    
    public static void print(ArrayList<Integer> a)
    {
        for(int e : a)
            System.out.print(e + " ");
        System.out.println();
    }
}


class IntMatrix
{
    public static int[][] input(BufferedReader br, int n, int m) throws IOException
    {
        int[][] mat = new int[n][];
        
        for(int i = 0; i < n; i++)
        {
            String[] s = br.readLine().trim().split(" ");
            mat[i] = new int[s.length];
            for(int j = 0; j < s.length; j++)
                mat[i][j] = Integer.parseInt(s[j]);
        }
        
        return mat;
    }
    
    public static void print(int[][] m)
    {
        for(var a : m)
        {
            for(int e : a)
                System.out.print(e + " ");
            System.out.println();
        }
    }
    
    public static void print(ArrayList<ArrayList<Integer>> m)
    {
        for(var a : m)
        {
            for(int e : a)
                System.out.print(e + " ");
            System.out.println();
        }
    }
}

class GFG {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t;
        t = Integer.parseInt(br.readLine());
        while(t-- > 0){
            
            int[] a = new int[2];
            String s[] = br.readLine().trim().split(" ");
            if(s.length == 2){
                a[0] = Integer.parseInt(s[0]);
                a[1] = Integer.parseInt(s[1]);
            } else{
                a[0] = Integer.parseInt(s[0]);
                s = br.readLine().trim().split(" ");
                a[1] = Integer.parseInt(s[0]);
            }
            int[][] edges = IntMatrix.input(br, a[1], 2);
            
            
            int src; 
            src = Integer.parseInt(br.readLine());
            
            
            int dst; 
            dst = Integer.parseInt(br.readLine());
            
            Solution obj = new Solution();
            int res = obj.minimumEdgeReversal(edges, a[0], a[1], src, dst);
            
            System.out.println(res);
            
        }
    }
}

// } Driver Code Ends


class Solution {
    public static int minimumEdgeReversal(int[][] edges, int n, int m, int src, int dst) {
        //taking input
        ArrayList<ArrayList<pair>> graph = new ArrayList<>();
        for(int i = 0 ;i < n ; i++)
        graph.add(new ArrayList<>());
        
        for(int edge[] : edges){
            //making into 0 based indexing
            graph.get(edge[0]-1).add(new pair(edge[1]-1,0));
            graph.get(edge[1]-1).add(new pair(edge[0]-1,1));
        }
        
        boolean visited[] = new boolean[n];
        
        /* now using 0-1 bfs , we just replaec PQ with linkedlist and make 2 partion
        as there are just 2 weights in the graph , +0 edges are added in the
        front and +1 are added in the end , makes complexity O(E+V)
        */
        LinkedList<pair> q = new LinkedList<>();
        q.addLast(new pair(src-1 , 0));
        
        while(q.size() > 0){
            pair rem = q.removeFirst();
            int vtx = rem.vtx , wt = rem.wt;
            
            visited[vtx] = true;
            
            if(vtx == dst-1)
            return wt;
            
            for(pair edge : graph.get(vtx)){
                
                if(visited[edge.vtx] == false){
                    if(edge.wt == 0)
                    q.addFirst(new pair(edge.vtx , wt + 0));
                    
                    else
                    q.addLast(new pair(edge.vtx , wt + 1));
                }
            }
            
        }
        return - 1;
    }
    
    public static class pair implements Comparable<pair>{
        int vtx , wt; 
        
        pair(int vtx , int wt){
            this.vtx = vtx;
            this.wt = wt;
        }
        
        public int compareTo(pair o){
            return this.wt - o.wt;
        }
    }
}
        
//{ Driver Code Starts
import java.io.*;
import java.util.*;


class IntArray
{
    public static int[] input(BufferedReader br, int n) throws IOException
    {
        String[] s = br.readLine().trim().split(" ");
        int[] a = new int[n];
        for(int i = 0; i < n; i++)
            a[i] = Integer.parseInt(s[i]);
        
        return a;
    }
    
    public static void print(int[] a)
    {
        for(int e : a)
            System.out.print(e + " ");
        System.out.println();
    }
    
    public static void print(ArrayList<Integer> a)
    {
        for(int e : a)
            System.out.print(e + " ");
        System.out.println();
    }
}


class IntMatrix
{
    public static int[][] input(BufferedReader br, int n, int m) throws IOException
    {
        int[][] mat = new int[n][];
        
        for(int i = 0; i < n; i++)
        {
            String[] s = br.readLine().trim().split(" ");
            mat[i] = new int[s.length];
            for(int j = 0; j < s.length; j++)
                mat[i][j] = Integer.parseInt(s[j]);
        }
        
        return mat;
    }
    
    public static void print(int[][] m)
    {
        for(var a : m)
        {
            for(int e : a)
                System.out.print(e + " ");
            System.out.println();
        }
    }
    
    public static void print(ArrayList<ArrayList<Integer>> m)
    {
        for(var a : m)
        {
            for(int e : a)
                System.out.print(e + " ");
            System.out.println();
        }
    }
}

class GFG {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t;
        t = Integer.parseInt(br.readLine());
        while(t-- > 0){
            
            int[] a = new int[2];
            String s[] = br.readLine().trim().split(" ");
            if(s.length == 2){
                a[0] = Integer.parseInt(s[0]);
                a[1] = Integer.parseInt(s[1]);
            } else{
                a[0] = Integer.parseInt(s[0]);
                s = br.readLine().trim().split(" ");
                a[1] = Integer.parseInt(s[0]);
            }
            int[][] edges = IntMatrix.input(br, a[1], 2);
            
            
            int src; 
            src = Integer.parseInt(br.readLine());
            
            
            int dst; 
            dst = Integer.parseInt(br.readLine());
            
            Solution obj = new Solution();
            int res = obj.minimumEdgeReversal(edges, a[0], a[1], src, dst);
            
            System.out.println(res);
            
        }
    }
}

// } Driver Code Ends


class Solution {
    public static int minimumEdgeReversal(int[][] edges, int n, int m, int src, int dst) {
        //taking input
        ArrayList<ArrayList<pair>> graph = new ArrayList<>();
        for(int i = 0 ;i < n ; i++)
        graph.add(new ArrayList<>());
        
        for(int edge[] : edges){
            //making into 0 based indexing
            graph.get(edge[0]-1).add(new pair(edge[1]-1,0));
            graph.get(edge[1]-1).add(new pair(edge[0]-1,1));
        }
        
        boolean visited[] = new boolean[n];
        //making priority queue for djikstra
        PriorityQueue<pair> q = new PriorityQueue<>();
        q.add(new pair(src-1,0));
        
        //djikstra
        while(q.size()>0){
            pair rem = q.poll();
            int vtx = rem.vtx , wt = rem.wt;
            
            visited[vtx] = true;
            
            if(vtx == dst-1)
            return wt;
            
            for(pair nbr: graph.get(vtx)){
                
                if(visited[nbr.vtx] == false){
                    
                    q.add(new pair(nbr.vtx , nbr.wt + wt));
                }
            }
            
        }
        return -1;
    }
    
    public static class pair implements Comparable<pair>{
        int vtx , wt; 
        
        pair(int vtx , int wt){
            this.vtx = vtx;
            this.wt = wt;
        }
        
        public int compareTo(pair o){
            return this.wt - o.wt;
        }
    }
}
        
class Solution {
    public int slidingPuzzle(int[][] board) {
        /* Q9 of graph playlist , we make a allowed swaps for every index and call bfs
            for intial string and whenever initial string is equal to target string we return
            that level
        */

        //making a hashset of visited strings
        HashSet<String> set = new HashSet<>();

        String target = "123450";
        
        //making initial string
        StringBuilder sb = new StringBuilder();
        for(int i = 0 ;i < board.length ; i++){
            for(int j = 0 ; j < board[0].length ; j++){
                sb.append(board[i][j]);
            }
        }
        String initial = sb.toString();

        //making a q and adding initial to the q
        LinkedList<String> q= new LinkedList<>();
        q.addLast(initial);

        //make 2d array for allowed swaps for every index
        int [][] swaps = {{1,3} , {0,4 ,2}, {1,5} , {0,4}, {1 ,3 ,5} , {2 , 4}};

        //applying bfs and returning level
        int level = 0;

        while(q.size() > 0){
            int size = q.size();
            while(size-- > 0){
                String rem = q.pop();
                
                // System.out.println(target + "->" + rem);
                if(rem.equals(target))
                return level;

                //find 0th index in current string
                int idx = rem.indexOf('0');

                // System.out.println(idx);
                //applying swaps 
                for(int swap : swaps[idx]){
                    String swapped = swap(idx , swap , rem);
                    // System.out.println(swapped);

                    if(set.contains(swapped) == false){
                        set.add(swapped);
                        q.add(swapped);
                    }
                    
                }
            }
            level++;
        }
        return -1;
    }

    public String swap (int i , int j , String str){
        StringBuilder sb = new StringBuilder(str);

        sb.setCharAt(i , str.charAt(j));
        sb.setCharAt(j , str.charAt(i));

        return sb.toString();
    }
}







class Solution {
    public int numBusesToDestination(int[][] routes, int source, int target) {
       /* Q8 graph playlist , make a hashmap of busstops - busses , busvisited , 
       busStop visited . first add all busStops -> busses in hashmap 
       
       add source bus to q and fire bfs with a level variable in 2 while loops
       
       take out bus from busstops in HM and add all busStops which can be reached from that
       busStop , as they can all reach with 1 bus only , mark bus and bus stop visited and 
       increase level 

       return level when target busStop is reachedd
       */

       //making a HM of busstops -> busno.
       HashMap<Integer,ArrayList<Integer>> map = new HashMap<>();

       //adding bustops -> busno.
       for(int i =0 ; i< routes.length ; i++){
           for(int j = 0 ; j < routes[i].length ; j++){
               ArrayList<Integer> temp = map.getOrDefault(routes[i][j] , new ArrayList<>());
               temp.add(i);
               map.put(routes[i][j] , temp);
           }
       }

       LinkedList<Integer> q = new LinkedList<>();
       HashSet<Integer> busVisited = new HashSet<>();
       HashSet<Integer> busStopVisited = new HashSet<>();
       int level = 0;

        //adding source busStop to Q
        q.addLast(source);

        while(q.size() > 0){
            int size = q.size();

            while(size-- > 0){
                //getting busses corresponding to bus stop
                int rem = q.pop();
                if(rem == target)
                return level;

                ArrayList<Integer> busses = map.get(rem);

                //looping over all the busses which can be taken from the current busStop
                for(int bus : busses){
                    
                    //only if the bus is not visited
                    if(busVisited.contains(bus) == false){
                        int [] busStops = routes[bus];
                        
                        //getting busStops which can be reached for current bus
                        for(int busStoops : busStops){
                            
                            //only if the busStop is not visited
                            if(busStopVisited.contains(busStoops) == false){
                                q.addLast(busStoops);
                                busStopVisited.add(busStoops);  //marking visited
                            }
                        }
                        busVisited.add(bus);    //marking visited
                    }
                }
                
            }
            level++;
        }

        return - 1;
       
    }
}









class Solution {
    public int shortestBridge(int[][] grid) {
        int m = grid.length , n = grid[0].length ;
        LinkedList<int[]> q = new LinkedList<>();
        boolean flag = false;
        boolean [][] visited = new boolean[m][n];

        for(int i = 0 ;i < m ;i++){
            for(int j = 0 ; j < n ;j++){
                if(grid[i][j] == 1){
                    dfs(grid , i , j , m , n ,visited , q);
                    flag = true;
                    break;
                }
            }
            if(flag) break;
        }

        int distance = 0;
        //firing bfs
        while(q.size()>0){
            int size = q.size();
            while(size-- > 0){
                int[] rem = q.pop();
            
                for(int i = 0 ;i < 4 ; i++){
                    int rowdash = rem[0] + dir[i][0];
                    int coldash = rem[1] + dir[i][1];

                    if(rowdash >= 0 && coldash >=0 && rowdash < m && coldash < n && 
                    visited[rowdash][coldash] == false ){
                        if(grid[rowdash][coldash] == 1)
                        return distance;
                        q.addLast(new int[]{rowdash,coldash});
                        visited[rowdash][coldash] = true;
                    }
                    
                }
            }
            distance ++ ;
        }
        return -1;
    }

    public void dfs(int[][] grid , int row , int col , int m , int n ,boolean[][] visited ,
    LinkedList<int[]> q){
        if(row < 0 || col < 0 || row >= m || col >= n || visited[row][col] == true || 
        grid[row][col] == 0)
        return;

        visited[row][col] = true;
        q.addLast(new int[]{row,col});

        for(int i = 0 ;i < 4 ; i++){
            dfs(grid , row + dir[i][0] ,col + dir[i][1] , m , n ,visited , q);
        }
    }

    public int dir [][] = {{0,1},{1,0},{-1,0},{0,-1}};

    // public class pair{
    //     int x , y , dist;

    //     pair(int x , int y , int dist){
    //         this.x = x; this.y = y ; this.dist = dist;
    //     }
    // }
}








class Solution {
    public int shortestBridge(int[][] grid) {
        /* Q7 of graph playlist , we know there are just 2 islands , therefore we will first
        
        we will traverse the array and fire dfs from the first 1 we encounter to store that 
        island in the queue , then break out of the loop

        now that we have 1 island we will fire BFS , from all 1s of this island which is 
        stored in the queue to find the nearest 1 of 2nd island , the first 1 we encounter
        we will return level of that 1 as that will be no. of 0s to be flipped
        */

        int m = grid.length , n = grid[0].length ;
        LinkedList<pair> q = new LinkedList<>();
        boolean flag = false;
        boolean [][] visited = new boolean[m][n];

        //finding first 1
        for(int i = 0 ;i < m ;i++){
            for(int j = 0 ; j < n ;j++){
                if(grid[i][j] == 1){
                    //firing dfs to find 1st island and store all 1s in Q
                    dfs(grid , i , j , m , n ,visited , q);
                    flag = true;
                    break;
                }
            }
            if(flag) break;
        }

        //firing bfs
        while(q.size()>0){
            pair rem = q.pop();
            int row = rem.x ; int col = rem.y ; int dist = rem.dist;

            for(int i = 0 ;i < 4 ; i++){
                int rowdash = row + dir[i][0];
                int coldash = col + dir[i][1];

                //if valid cell , make it true and add to q
                if(rowdash >=0 && coldash >=0 && rowdash < m && coldash < n && 
                visited[rowdash][coldash] == false ){
                    if(grid[rowdash][coldash] == 1)
                    return dist;    

                    visited[rowdash][coldash] = true;
                    q.addLast(new pair(rowdash ,coldash , dist + 1));
                }
                
            }
            
        }
        return -1;
    }

    public void dfs(int[][] grid , int row , int col , int m , int n ,boolean[][] visited ,
    LinkedList<pair> q){
        if(row < 0 || col < 0 || row >= m || col >= n || visited[row][col] == true || 
        grid[row][col] == 0)
        return;

        //marking the element true and adding it to the q
        visited[row][col] = true;
        q.addLast(new pair(row , col , 0));

        for(int i = 0 ;i < 4 ; i++){
            dfs(grid , row + dir[i][0] ,col + dir[i][1] , m , n ,visited , q);
        }
    }

    //direction array
    public int dir [][] = {{0,1},{1,0},{-1,0},{0,-1}};

    //pair class for row , col and distance
    public class pair{
        int x , y , dist;

        pair(int x , int y , int dist){
            this.x = x; this.y = y ; this.dist = dist;
        }
    }
}








class Solution {
    public int maxDistance(int[][] grid) {
        /* Q-6 of graph playlist , we make a pair class with row , col , distance  , first 
        add all 1s to the q with distance 0 , fire bfs , encountering a 0 we change it to 1
        and make its distance + 1 
        
        we keep a max variable also while we fire bfs and store max distance along the way
        
        */
        int m = grid.length , n = grid[0].length ;
        LinkedList<pair> q = new LinkedList<>();
        
        //adding all 1s to q
        int water = 0 , land = 0;
        for(int i = 0 ;i < m ;i++){
            for(int j = 0 ; j < n ;j++){
                if(grid[i][j] == 1){
                    land ++;
                    q.addLast(new pair(i, j , 0));
                }
                

                else
                water++;
            }
        }
        
        //edge case
        if(water == 0 || land == 0)  return -1;

    
        int max = -1;
        //firing bfs
        while(q.size() > 0){
            pair rem = q.removeFirst();
            int row = rem.x ; int col = rem.y ; int dist = rem.dist;

            max = Math.max(dist , max);

            for(int i =0 ;i < 4 ; i++){
                int rowdash = row + dir[i][0];
                int coldash = col + dir[i][1];

                //if valid water cell change it to land cell and make its dist + 1
                if(rowdash >=0 && coldash >=0 && rowdash < m && coldash < n &&
                grid[rowdash][coldash] == 0){
                    grid[rowdash][coldash] = 1;
                    q.add(new pair(rowdash , coldash , dist + 1));
                }
            }
        }

        return max;
    }

    public int dir [][] = {{0,1},{1,0},{-1,0},{0,-1}};

    public class pair{
        int x , y , dist;

        pair(int x , int y , int dist){
            this.x = x; this.y = y ; this.dist = dist;
        }
    }
}
class Solution {
    public int orangesRotting(int[][] grid) {
        /* Q5 of graph playlist , we make a pair class with row , col , time , we add all 
        2's in the q and fire bfs , and increase the time of the next oranges as that 
        will be the time it takes for them to become rotten and then we also add those 
        oranges in the queue
        */
        LinkedList<pair> q = new LinkedList<>();
        int m = grid.length , n = grid[0].length;

        //counting fresh oranges and adding rottens to queue
        int fresh = 0 ;
        for(int i = 0 ;i < m ; i++){
            for(int j = 0 ; j < n ; j++){
                if(grid[i][j] == 2)
                q.addLast(new pair(i , j , 0));
                
                else if(grid[i][j] == 1)
                fresh ++;
                
            }
        }

        int time = 0;
        //firing bfs
        while(q.size() > 0){
            pair rem = q.removeFirst();
            time = rem.time;
            int row = rem.x ;
            int col = rem.y;

            //adding next rotten oranges and updating their time
            for(int i = 0 ;i < 4 ; i++){
                int rowdash = row + dir[i][0];
                int coldash = col + dir[i][1];

                if(rowdash >= 0 && coldash >= 0 && rowdash < m && coldash < n &&
                grid[rowdash][coldash] == 1){
                    grid[rowdash][coldash] = 2;
                    fresh --;
                    q.addLast(new pair(rowdash,coldash , time + 1));
                }
            }
        }
        
        System.out.println(time);
        return fresh == 0 ? time : -1;
    }

    //directions and pair class with row , col , time
    public int[][] dir = {{0,1} , {1,0} , {-1,0} , {0,-1}};
    public class pair{
        int x , y , time;

        pair(int x , int y ,int time){
            this.x = x;
            this.y = y;
            this.time = time;
        }
    }
}
class Solution {
    public int[][] updateMatrix(int[][] mat) {
        /* Q4 of graph playlist , add all zeroes to q and mark all 1 to -1 , fire bfs from 
        all zeroes to find nearest 1 and update distance of 1 
        */
        int m = mat.length , n = mat[0].length;

        LinkedList<pair> q = new LinkedList<>();

        //adding all zeroes to the q
        for(int i =0 ; i < m ; i++){
            for(int j = 0 ; j < n ;j++){
                if(mat[i][j] == 0)
                q.addLast(new pair(i , j));

                else
                mat[i][j] = -1; //marking the cell as unvisited
            }
        }

        //firing reverse bfs from zeroes to solve all 1's
        while(q.size()>0){
            pair rem = q.removeFirst();

            for(int i = 0 ;i < 4 ; i++){
                int rowdash = rem.x + dir[i][0];
                int coldash = rem.y + dir[i][1];

                //if valid cell
                if(rowdash >= 0 && coldash >= 0 && rowdash < m && coldash < n &&
                mat[rowdash][coldash] < 0){

                    //updating distance of the cell
                    mat[rowdash][coldash] = mat[rem.x][rem.y] + 1;
                    //adding it to q to solve further cells
                    q.addLast(new pair(rowdash , coldash));
                }
                
            }
        }

        return mat;

    }
    public int[][] dir = {{0,1},{1,0},{-1,0},{0,-1}};
    public class pair {
        int x , y;
        
        pair(int x , int y){
            this.x = x;
            this.y = y;
        }
    }
}
//{ Driver Code Starts
// Initial Template for Java

import java.util.*;
import java.lang.*;
import java.io.*;

// Position this line where user code will be pasted.

class GFG {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        while (T-- > 0) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int[][] grid = new int[n][m];

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

                for (int j = 0; j < m; j++) {
                    grid[i][j] = sc.nextInt();
                }
            }

            Solution ob = new Solution();
            int ans = ob.countDistinctIslands(grid);
            System.out.println(ans);
        }
    }
}
// } Driver Code Ends


// User function Template for Java

class Solution {

    int countDistinctIslands(int[][] grid) {
        /*Q3 of graph playlist , we will find GCC and store the structure in form
        of string in a hashmap , if the same structure appears it wont be added in
        the hashmap 
        -> we will also add a character in string when backtracking (*edge case*) 
        -> we will return length of hashmap in the end
        */
        int m = grid.length , n = grid[0].length ;
    
        HashSet<String> set = new HashSet<>();
        for(int i =0 ;i < m ; i++){
            for(int j = 0 ;j < n ;j++){
                
                if(grid[i][j] == 1){
                    psf = new StringBuilder();
                    psf.append("x");
                    dfs(grid , i , j , m, n);
                    // System.out.println(psf);
                    set.add(psf.toString());
                }
                
            }
        }
        return set.size();
    }
    // up right down left
    public StringBuilder psf = new StringBuilder(); //path so far = structure
    public void dfs(int[][] grid , int row , int col , int m , int n ){
        //we need to make proactive call as we have to handle for psf
        
        grid[row][col] = 0; //marking 
        if(row-1 >= 0 && grid[row-1][col] == 1){
            psf.append("u");
            dfs(grid , row-1 , col , m , n);
        }
        
        if(col+1 < n && grid[row][col+1] == 1){
            psf.append("r");
            dfs(grid , row , col+1 , m , n);
        }
        
        if(row+1 < m && grid[row+1][col] == 1){
            psf.append("d");
            dfs(grid , row+1 , col , m , n);
        }
        
        if(col-1 >= 0 && grid[row][col-1] == 1){
            psf.append("l");
            dfs(grid , row , col-1 , m , n);
        }
        
        //adding backtracking character
        psf.append("z");
    }
}













class Solution {
    public int numEnclaves(int[][] grid) {
        /* Q2 of graph playlist , we fire GCC from boundary elements and make all 1's in those
        components as 0 , then we count left no. of 1's in the grid as those are the land cell
        which will not lead to boundary
        */
        
        //firing DFS to find components from boundary elements and making them 0
        int m = grid.length , n = grid[0].length;

        for(int i = 0 ;i < m ; i++){
            for(int j = 0 ; j< n ; j++){
                if(i == 0 || i == m-1 || j == 0 || j == n-1){
                    if(grid[i][j] == 1)
                    dfs(grid , i , j , m , n);
                }
            }
        }

        // count no. of land cells and return them
        int count = 0;
        for(int i = 0 ;i < m ; i++){
            for(int j = 0 ; j< n ; j++){
                    if(grid[i][j] == 1)
                    count++;
            }
        }
        return count;
    }

    int[][] dir = {{0,1},{1,0},{0,-1},{-1,0}};
    public void dfs (int[][] grid , int row , int col , int m , int n){
        //base case
        if(row < 0 || col < 0 || row >= m || col >= n || grid[row][col] == 0)
        return;
        
        //making component's 1 to 0
        grid[row][col] = 0;
        
        for(int i =0 ;i < 4 ; i++)
        dfs(grid , row + dir[i][0] , col + dir[i][1] , m ,n);
    }
}
class Solution {
    public int[][] colorBorder(int[][] grid, int row, int col, int color) {
        /*Q-1 of graph playlist , we will fire DFS to find component and 
        also pass a count(which will keep track of same color neighours) , we will make the
        element visited by making its value negative 

        while backtracking we will change elements to positive which have count == 4 as those 
        will not be colored as they are not on the boundary
         */

        //taking out current color for component and firing DFS
        int comp = grid[row][col];
        int m = grid.length , n = grid[0].length;
        
        DFS(grid , row , col , comp , m , n);

        //changing negative elements to color
        for(int i = 0 ;i < m;i++){
            for(int j = 0 ; j < n ; j++){
                if(grid[i][j] < 0)
                grid[i][j] = color;
            }
        }
        return grid;
    }

    //direction variable for making calls
    public int[][] dir = {{0,1},{1,0},{0,-1},{-1,0}};

    public void DFS(int[][] grid, int row, int col, int comp , int m , int n ){
        
        grid[row][col] = -comp; //marking visited 
        int count = 0 ; 
        for(int i =0 ; i < 4;i++){
            int rowdash = row + dir[i][0];
            int coldash = col + dir[i][1];
            
            //base condition if neighour is not valid
            if(rowdash < 0 || coldash < 0 || rowdash >= m || coldash >= n ||
            Math.abs(grid[rowdash][coldash]) != comp)
            continue;
            
            //if neighour is valid count++
            count ++; 

            //if neighour is not visited call it
            if(grid[rowdash][coldash] > 0 )
            DFS(grid , rowdash , coldash , comp , m , n);
        }
        //while backtracking checking if its a boundary element
        //if all neighours are equal to comp its not a boundary element
        if(count == 4)
        grid[row][col] = comp;
    }
}











class Solution {
    public int uniquePathsWithObstacles(int[][] grid) {
        
        int m = grid.length;
        int n = grid[0].length;

        int dp[][] = new int [m][n];

        //if robot is on the 0,0 return 0
        if(grid[0][0] == 1) return 0;

        //traversing first row and coloumn 
        for(int j = 0 ; j < n ; j++){
            
            if(grid[0][j] == 1){ //that is a obstacle exist in this row
                dp[0][j] = 0;
                break;
            }

            else
            dp[0][j] = 1;         //one way to reach that cell
            
        }

        for(int i = 0 ; i < m ; i++){
            
            if(grid[i][0] == 1){    //that is a obstacle exist in first coloumn
                dp[i][0] = 0;
                break;
            }

            else
            dp[i][0] = 1; 
        }

        for(int i = 0 ; i < m ; i++){
            for(int j = 0 ; j < n ; j++){
                System.out.print(dp[i][j]);
            }
            System.out.println();
        }

        //now traversing rest of the grid

        for(int i = 1 ; i < m ; i++){
            for(int j = 1 ; j < n ; j++){

                if(grid[i][j] == 1)
                dp[i][j] = 0;         //no way of reaching if its an obstacle

                else
                dp[i][j] = dp[i-1][j] + dp[i][j-1];
            }
        }

        
            
        
        return dp[m-1][n-1];

    }
}

























class Solution {
    public int uniquePathsIII(int[][] grid) {
        /* 
        basically this is a question of hamiltonian path in graphs
        
        find position of 1 and send it to dfs function if there exists a path with 
        only one visit per node we will increase the count
        */
        int m  = grid.length  , n = grid[0].length;

        //finding position of 1 and count no. of -1 
        int pos_x = 0  , pos_y = 0; //finding position of 1
        
        int count = 0;        //calculating no. of -1

        HashSet<String> visited = new HashSet<>();
        
        for(int i = 0 ; i< m ; i++){
            for(int j = 0 ; j < n ;j++){

                if(grid[i][j] == 1){
                    pos_x = i ;
                    pos_y = j ;
                }

                else if(grid[i][j] == -1)
                count ++;
            }
        }
        //finding total no.of tiles without -1 
        count = m*n - count -1 ;
        dfs(grid , pos_x , pos_y , visited , count);

        return paths;
    }

    public int paths = 0;

    public void dfs(int[][] grid , int i , int j , HashSet<String> visited , int count){
        //base case
        if(i < 0 || j < 0 || i >= grid.length || j >= grid[0].length ||
        visited.contains(i + "*" + j) || grid[i][j] == -1)
        return ;

        //when at destination , check if all the vertices are covered
        if(grid[i][j] == 2){
            
            System.out.println(visited.size() + "->" + count);
            
            if(visited.size() == count)
            paths++;

            return;
        }
        
        StringBuilder sb = new StringBuilder();
        sb.append(i + "*" + j);
        
        visited.add(sb.toString());
        
        //calls for 4 directions
        dfs(grid , i , j+1 , visited , count);
        dfs(grid , i , j-1 , visited , count);
        dfs(grid , i+1 , j , visited , count);
        dfs(grid , i-1 , j , visited , count);
        
        visited.remove(sb.toString());

    }
}





class Solution {
    public int findCircleNum(int[][] isConnected) {
        /* convert this question to graph components */

        //making graph using input
        HashMap<Integer,ArrayList<Integer>> graph = new HashMap<>();
        int n = isConnected.length;   //nxn matrix

        for(int i = 0 ; i < n ;i++){
            for(int j = 0 ; j < n ; j++){
                
                //storing edges between nodes
                if(isConnected[i][j] == 1){
                    graph.computeIfAbsent(i , k -> new ArrayList<>()).add(j);
                    graph.computeIfAbsent(j , k -> new ArrayList<>()).add(i);
                }
            }
        }

        boolean visited[] = new boolean[n];
        int component = 0;
        //looping through every node and firing dfs
        for(int i = 0 ; i < n ; i++){

            if(visited[i] == false){
                
                dfs(graph , i , visited);
                component++;
            }
        }

        return component;
    }

    public void dfs (HashMap<Integer,ArrayList<Integer>> graph , int source ,
    boolean[] visited){

        visited[source] = true;

        for(int edge : graph.get(source)){
            if(visited[edge] == false)
            dfs(graph , edge , visited);
        }
    }












}
class Solution {
    public int numIslands(char[][] grid) {
        /* we treat this like a question of graph to find components which are 
        islands in this case 
        */
        boolean visited[][] = new boolean [grid.length][grid[0].length];
        int component = 0;

        //dfs from every node 
        for(int i = 0 ; i < grid.length ;i++){

            for(int j = 0 ; j < grid[0].length ;j++){
                
                //if it is land and visited is false
                if(grid[i][j] == '1' && visited[i][j] == false){

                    dfs(grid , i , j , visited);
                    
                    component++;
                }
                
            }
        }

        return component;
    }

    public void dfs (char[][]grid , int i , int j , boolean[][] visited){
        
        //base case
        if(i < 0 || j < 0 || i >= grid.length || j >= grid[0].length
        || visited[i][j] == true || grid[i][j] == '0')
        return ;

            visited[i][j] = true;
            
            //going in all 4 directions

            dfs(grid , i , j+1 , visited);
            dfs(grid , i+1 , j , visited);
            dfs(grid , i-1 , j , visited);
            dfs(grid , i , j-1 , visited);
        
    }


}
class Solution {
    public int makeConnected(int n, int[][] connections) {
        //edge case - if we are given less than n-1 nodes to connect n nodes

        if(connections.length < n-1)
        return -1;

        /* 
        find no. of components in the graph(c) and assume them to be an 
        individual node , therefore we will need c-1 edges to connect them
        */
        int c = 0;

        //make a graph using HM
        HashMap<Integer,ArrayList<Integer>> graph = new HashMap<>();
        
        for(int connection[] : connections){
            int a = connection[0] , b = connection[1];

            graph.computeIfAbsent(a , k -> new ArrayList<>()).add(b);
            graph.computeIfAbsent(b , k -> new ArrayList<>()).add(a);
        }
        
        System.out.println(graph);
        //visited array 
        boolean visited[] = new boolean[n];
        
        //finding all components by using dfs on every node

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

            if(visited[i] == false){
                
                if(graph.containsKey(i))
                dfs(graph , i , visited);

                c++;

            }
            
        }

        return c - 1;

        
    }

    public void dfs (HashMap<Integer,ArrayList<Integer>> graph , int source , 
    boolean[] visited ){

        
        visited[source] = true;

        for(int edge : graph.get(source)){
            if(visited[edge] == false)
            dfs(graph , edge , visited);
        }

        return ;
    }






}
class Solution {
    public List<List<Integer>> allPathsSourceTarget(int[][] graph) {
        
        /* we dont need visited in this question as input is provided uniquely*/
        
        List<List<Integer>> psf = new ArrayList<>(); //paths so far
        List<Integer> path = new ArrayList<>();        //current path

        //adding current edge
        path.add(0);

        //graph , source , destination , visited , paths so far
        dfs(graph, 0 , graph.length-1 ,psf , path);

        return psf;
    }

    public void dfs(int[][] graph , int source , int destination ,List<List<Integer>>psf ,List<Integer> path ){

        //adding path in the paths so far arraylist
        if(source == destination){
            psf.add(new ArrayList<>(path));
            return;
        }

        for(int edge : graph[source]){
            
            path.add(edge);  //adding current edge in current path
            
            //calling dfs for current edge
            dfs(graph , edge , destination , psf , path);

            //removing current edge as we explore different edges
            path.remove(path.size() - 1);
            
        }

        return;
    }   
}













class Solution {
    public boolean validPath(int n, int[][] edges, int source, int destination) {
        //make HM for vertices and edges
        HashMap<Integer,ArrayList<Integer>> graph = new HashMap<>();

        for(int edge[] : edges){
            int a = edge[0] , b = edge[1];
            
            graph.computeIfAbsent(a , k -> new ArrayList<>()).add(b);
            graph.computeIfAbsent(b , k -> new ArrayList<>()).add(a);
        }

        //to prevent infinite loop between neighours
        boolean[] visited = new boolean[n];

        return dfs(graph , source , destination , visited);
    }

    //recursive  DFS
    public boolean dfs(HashMap<Integer,ArrayList<Integer>> graph,int source , 
    int destination , boolean visited[]){

        if(source == destination)
        return true;
        
        //mark the source first
        visited[source] = true;

        for(int edge : graph.get(source)){
            
            if(visited[edge] == false){

                if(dfs(graph , edge , destination , visited))
                return true;
            }
        }

        return false;
    }
}
class Solution {
    // Function to detect cycle in a directed graph.
    /* we will use topological sort for this , we will keep 2 boolean array visited and
    recursion_stack 
    
    if a cycle is present it will come in the recursion_stack , as its a DAG 
    
    Algo
    1) fire topological sort from all vertice 
    2) if from any vertice you find an already visited vertex in the same recursion , there is a cycle
    */
    public boolean isCyclic(int v, ArrayList<ArrayList<Integer>> graph) {
        boolean visited[] = new boolean[v];
        boolean recursion_stack[] = new boolean[v];
        
        for(int i = 0 ; i< v; i++){
            
            if(visited[i] == false){
                if(topo(graph,visited , recursion_stack , i))
                return true;
            }
        }
        
        return false;
    }
    
    public boolean topo(ArrayList<ArrayList<Integer>> graph , boolean visited[],boolean recursion_stack[] , int src){
        //if same vertex is coming again in the same recursion stack , there is a cycle
        if(recursion_stack[src] == true)
        return true;
        
        //an already visited vertex can come 
        if(visited[src] == true)
        return false;
        
        //marking vertex as visited in visited[] and current recursion_stack[]
        visited[src] = true;
        recursion_stack[src] = true;
        
        //adding neighours
        for(int edge : graph.get(src)){
            if(topo(graph , visited , recursion_stack , edge))
            return true;
        }
        
        //removing src from current recursion_stack while backtracking
        recursion_stack[src] = false;
        
        return false;
    }
    
    
//using kahn's algo 
    public boolean isCyclic(int V, ArrayList<ArrayList<Integer>> adj) {
        ans = new int[V];
        idx = 0;
        
        kahn(V , adj);
        
        return idx == V ? false : true;
    }
    static int ans[];
    static int idx ;
    public static void kahn(int v, ArrayList<ArrayList<Integer>> graph){
        
        //find indegree
        int indegree[] = new int[v];
        for(int i = 0 ;i < v ; i++){
            for(int edge : graph.get(i)){
                indegree[edge] ++;
            }
        }
        
        //add indegree 0 to q 
        Queue<Integer> q = new ArrayDeque<>();
        for(int i = 0 ;i < v ; i++){
            if(indegree[i] == 0)
            q.add(i);
        }
        
        //DAG no need of visited
        //fire BFS 
        while(q.size() > 0){
            int rem = q.remove();
            
            ans[idx] = rem;
            idx++;
            
            //reduce indegree of nbrs and add it in the q if 0
            //0 means no dependencies they can be printed
            for(int edge: graph.get(rem)){
                indegree[edge]--;
                
                if(indegree[edge] == 0)
                q.add(edge);
            }
        }
        
        
    }
class Solution {
    static int[] bellman_ford(int vtx, ArrayList<ArrayList<Integer>> edges, int s) {
        path = new int[vtx];
    
        return bellman(vtx , edges , s) == true ? path : new int[]{-1};
    }
    
    static int path[];
    public static boolean bellman(int vtx, ArrayList<ArrayList<Integer>> edges, int s){
        Arrays.fill(path , 100000000);
        path[s] = 0;
        boolean negative_wtcyle = false;
        
        //we need only v-1 iteration but we check till v iteration to check for negative
        //wt cycle
        for(int i = 0 ;i < vtx ; i++){
            
            for(ArrayList<Integer> edge : edges){
                int u = edge.get(0), v = edge.get(1) , wt = edge.get(2);
                
                if(path[u] == Integer.MAX_VALUE)
                continue;
                
                if(path[u] + wt < path[v]){
                    path[v] = path[u]+wt;
                    
                    //if at vth iteration distance get updated its negative wt cycle
                    if(i == vtx-1)
                    negative_wtcyle = true;
                }
                
            }
        }
        
        return negative_wtcyle == false ? true : false;
    }
class Solution {
    public int minCost(int[][] grid) {
        /* already submitted a solution using BFS and DP 
            this one is simple solution using Djikstra and DP

            //we will not use pair class instead use array and lambda function
        */

        int m = grid.length, n = grid[0].length;
        PriorityQueue<int[]> q = new PriorityQueue<>((a,b) -> a[2] - b[2]);
        q.add(new int[]{0 , 0 ,0});

        /* we will make a dp array which will store minimum cost for every cell , this is to avoid using visited..
        as a new path can overlap an old path if it has a lesser path cost we will make this a dp array and not
        visited cause then a new path will not be able to overlap a previous path as that cell will already be true
        */

        int[][] costs = new int[m][n];   //dp array
        
        for(int temp[] : costs)                      //filling dp array
        Arrays.fill(temp , Integer.MAX_VALUE);

        //djikstra algo
        while(q.size() > 0){
            int[] rem = q.remove();
            int row = rem[0] , col = rem[1] , cost = rem[2];

            if(row == m-1 && col == n-1)
            return cost;

            //seeing neighours
            for(int i = 0 ; i < 4 ; i++){
                int rowdash = row + dir[i][0];
                int coldash = col + dir[i][1];

                //if valid cell
                if(rowdash >= 0 && coldash >= 0 && rowdash < m && coldash < n ){
                    
                    /* if new cost is < previous cost we update even if we have to revsit the node  -- this is 
                    alternate to visited array */
                    int new_cost = cost + (i+1 == grid[row][col] ? 0 : 1);

                    if(new_cost < costs[rowdash][coldash]){
                        costs[rowdash][coldash] = new_cost;
                        q.add(new int[]{rowdash , coldash , new_cost});
                    }
                }
            }
        }

        return 69;
    }

    public int[][] dir = {{0,1}, {0,-1} , {1,0} , {-1,0}};  //right , left , down , up
    
}

Similiar Collections

Python strftime reference pandas.Period.strftime python - Formatting Quarter time in pandas columns - Stack Overflow python - Pandas: Change day - Stack Overflow python - Check if multiple columns exist in a df - Stack Overflow Pandas DataFrame apply() - sending arguments examples python - How to filter a dataframe of dates by a particular month/day? - Stack Overflow python - replace a value in the entire pandas data frame - Stack Overflow python - Replacing blank values (white space) with NaN in pandas - Stack Overflow python - get list from pandas dataframe column - Stack Overflow python - How to drop rows of Pandas DataFrame whose value in a certain column is NaN - Stack Overflow python - How to drop rows of Pandas DataFrame whose value in a certain column is NaN - Stack Overflow python - How to lowercase a pandas dataframe string column if it has missing values? - Stack Overflow How to Convert Integers to Strings in Pandas DataFrame - Data to Fish How to Convert Integers to Strings in Pandas DataFrame - Data to Fish create a dictionary of two pandas Dataframe columns? - Stack Overflow python - ValueError: No axis named node2 for object type <class 'pandas.core.frame.DataFrame'> - Stack Overflow Python Pandas iterate over rows and access column names - Stack Overflow python - Creating dataframe from a dictionary where entries have different lengths - Stack Overflow python - Deleting DataFrame row in Pandas based on column value - Stack Overflow python - How to check if a column exists in Pandas - Stack Overflow python - Import pandas dataframe column as string not int - Stack Overflow python - What is the most efficient way to create a dictionary of two pandas Dataframe columns? - Stack Overflow Python Loop through Excel sheets, place into one df - Stack Overflow python - How do I get the row count of a Pandas DataFrame? - Stack Overflow python - How to save a new sheet in an existing excel file, using Pandas? - Stack Overflow Python Loop through Excel sheets, place into one df - Stack Overflow How do I select a subset of a DataFrame? — pandas 1.2.4 documentation python - Delete column from pandas DataFrame - Stack Overflow python - Convert list of dictionaries to a pandas DataFrame - Stack Overflow How to Add or Insert Row to Pandas DataFrame? - Python Examples python - Check if a value exists in pandas dataframe index - Stack Overflow python - Set value for particular cell in pandas DataFrame using index - Stack Overflow python - Pandas Dataframe How to cut off float decimal points without rounding? - Stack Overflow python - Pandas: Change day - Stack Overflow python - Clean way to convert quarterly periods to datetime in pandas - Stack Overflow Pandas - Number of Months Between Two Dates - Stack Overflow python - MonthEnd object result in <11 * MonthEnds> instead of number - Stack Overflow python - Extracting the first day of month of a datetime type column in pandas - Stack Overflow
MySQL MULTIPLES INNER JOIN How to Use EXISTS, UNIQUE, DISTINCT, and OVERLAPS in SQL Statements - dummies postgresql - SQL OVERLAPS PostgreSQL Joins: Inner, Outer, Left, Right, Natural with Examples PostgreSQL Joins: A Visual Explanation of PostgreSQL Joins PL/pgSQL Variables ( Format Dates ) The Ultimate Guide to PostgreSQL Date By Examples Data Type Formatting Functions PostgreSQL - How to calculate difference between two timestamps? | TablePlus Date/Time Functions and Operators PostgreSQL - DATEDIFF - Datetime Difference in Seconds, Days, Months, Weeks etc - SQLines CASE Statements in PostgreSQL - DataCamp SQL Optimizations in PostgreSQL: IN vs EXISTS vs ANY/ALL vs JOIN PostgreSQL DESCRIBE TABLE Quick and best way to Compare Two Tables in SQL - DWgeek.com sql - Best way to select random rows PostgreSQL - Stack Overflow PostgreSQL: Documentation: 13: 70.1. Row Estimation Examples Faster PostgreSQL Counting How to Add a Default Value to a Column in PostgreSQL - PopSQL How to Add a Default Value to a Column in PostgreSQL - PopSQL SQL Subquery - Dofactory SQL IN - SQL NOT IN - JournalDev DROP FUNCTION (Transact-SQL) - SQL Server | Microsoft Docs SQL : Multiple Row and Column Subqueries - w3resource PostgreSQL: Documentation: 9.5: CREATE FUNCTION PostgreSQL CREATE FUNCTION By Practical Examples datetime - PHP Sort a multidimensional array by element containing date - Stack Overflow database - Oracle order NULL LAST by default - Stack Overflow PostgreSQL: Documentation: 9.5: Modifying Tables PostgreSQL: Documentation: 14: SELECT postgresql - sql ORDER BY multiple values in specific order? - Stack Overflow How do I get the current unix timestamp from PostgreSQL? - Database Administrators Stack Exchange SQL MAX() with HAVING, WHERE, IN - w3resource linux - Which version of PostgreSQL am I running? - Stack Overflow Copying Data Between Tables in a Postgres Database php - How to remove all numbers from string? - Stack Overflow sql - How to get a list column names and datatypes of a table in PostgreSQL? - Stack Overflow postgresql - How do I remove all spaces from a field in a Postgres database in an update query? - Stack Overflow sql - How to get a list column names and datatypes of a table in PostgreSQL? - Stack Overflow How to change PRIMARY KEY of an existing PostgreSQL table? · GitHub Drop tables w Dependency Tracking ( constraints ) Import CSV File Into PosgreSQL Table How To Import a CSV into a PostgreSQL Database How can I drop all the tables in a PostgreSQL database? - Stack Overflow How can I drop all the tables in a PostgreSQL database? - Stack Overflow PostgreSQL CASE Statements & Examples using WHEN-THEN, if-else and switch | DataCamp PostgreSQL LEFT: Get First N Characters in a String How can I drop all the tables in a PostgreSQL database? - Stack Overflow How can I drop all the tables in a PostgreSQL database? - Stack Overflow PostgreSQL - Copy Table - GeeksforGeeks PostgreSQL BETWEEN Query with Example sql - Postgres Query: finding values that are not numbers - Stack Overflow PostgreSQL UPDATE Join with A Practical Example
Request API Data with JavaScript or PHP (Access a Json data with PHP API) PHPUnit – The PHP Testing Framework phpspec array_column How to get closest date compared to an array of dates in PHP Calculating past and future dates < PHP | The Art of Web PHP: How to check which item in an array is closest to a given number? - Stack Overflow implode php - Calculate difference between two dates using Carbon and Blade php - Create a Laravel Request object on the fly testing - How can I measure the speed of code written in PHP? testing - How can I measure the speed of code written in PHP? What to include in gitignore for a Laravel and PHPStorm project Laravel Chunk Eloquent Method Example - Tuts Make html - How to solve PHP error 'Notice: Array to string conversion in...' - Stack Overflow PHP - Merging two arrays into one array (also Remove Duplicates) - Stack Overflow php - Check if all values in array are the same - Stack Overflow PHP code - 6 lines - codepad php - Convert array of single-element arrays to one a dimensional array - Stack Overflow datetime - PHP Sort a multidimensional array by element containing date - Stack Overflow sql - Division ( / ) not giving my answer in postgresql - Stack Overflow Get current date, given a timezone in PHP? - Stack Overflow php - Get characters after last / in url - Stack Overflow Add space after 7 characters - PHP Coding Help - PHP Freaks php - Laravel Advanced Wheres how to pass variable into function? - Stack Overflow php - How can I manually return or throw a validation error/exception in Laravel? - Stack Overflow php - How to add meta data in laravel api resource - Stack Overflow php - How do I create a webhook? - Stack Overflow Webhooks - Examples | SugarOutfitters Accessing cells - PhpSpreadsheet Documentation Reading and writing to file - PhpSpreadsheet Documentation PHP 7.1: Numbers shown with scientific notation even if explicitely formatted as text · Issue #357 · PHPOffice/PhpSpreadsheet · GitHub How do I install Java on Ubuntu? nginx - How to execute java command from php page with shell_exec() function? - Stack Overflow exec - Executing a java .jar file with php - Stack Overflow Measuring script execution time in PHP - GeeksforGeeks How to CONVERT seconds to minutes? PHP: Check if variable exist but also if has a value equal to something - Stack Overflow How to declare a global variable in php? - Stack Overflow How to zip a whole folder using PHP - Stack Overflow php - Saving file into a prespecified directory using FPDF - Stack Overflow PHP 7.0 get_magic_quotes_runtime error - Stack Overflow How to Create an Object Without Class in PHP ? - GeeksforGeeks Recursion in PHP | PHPenthusiast PHP PDO Insert Tutorial Example - DEV Community PHP Error : Unparenthesized `a ? b : c ? d : e` is deprecate | Laravel.io mysql - Which is faster: multiple single INSERTs or one multiple-row INSERT? - Stack Overflow Display All PHP Errors: Basic & Advanced Usage Need to write at beginning of file with PHP - Stack Overflow Append at the beginning of the file in PHP - Stack Overflow PDO – Insert, update, and delete records in PHP – BrainBell php - How to execute a raw sql query with multiple statement with laravel - Stack Overflow
Clear config cache Eloquent DB::Table RAW Query / WhereNull Laravel Eloquent "IN" Query get single column value in laravel eloquent php - How to use CASE WHEN in Eloquent ORM? - Stack Overflow AND-OR-AND + brackets with Eloquent - Laravel Daily Database: Query Builder - Laravel - The PHP Framework For Web Artisans ( RAW ) Combine Foreach Loop and Eloquent to perform a search | Laravel.io Access Controller method from another controller in Laravel 5 How to Call a controller function in another Controller in Laravel 5 php - Create a Laravel Request object on the fly php - Laravel 5.6 Upgrade caused Logging to break Artisan Console - Laravel - The PHP Framework For Web Artisans What to include in gitignore for a Laravel and PHPStorm project php - Create a Laravel Request object on the fly Process big DB table with chunk() method - Laravel Daily How to insert big data on the laravel? - Stack Overflow php - How can I build a condition based query in Laravel? - Stack Overflow Laravel Chunk Eloquent Method Example - Tuts Make Database: Migrations - Laravel - The PHP Framework For Web Artisans php - Laravel Model Error Handling when Creating - Exception Laravel - Inner Join with Multiple Conditions Example using Query Builder - ItSolutionStuff.com laravel cache disable phpunit code example | Newbedev In PHP, how to check if a multidimensional array is empty? · Humblix php - Laravel firstOrNew how to check if it's first or new? - Stack Overflow get base url laravel 8 Code Example Using gmail smtp via Laravel: Connection could not be established with host smtp.gmail.com [Connection timed out #110] - Stack Overflow php - Get the Last Inserted Id Using Laravel Eloquent - Stack Overflow php - Laravel-5 'LIKE' equivalent (Eloquent) - Stack Overflow Accessing cells - PhpSpreadsheet Documentation How to update chunk records in Laravel php - How to execute external shell commands from laravel controller? - Stack Overflow How to convert php array to laravel collection object 3 Best Laravel Redis examples to make your site load faster How to Create an Object Without Class in PHP ? - GeeksforGeeks Case insensitive search with Eloquent | Laravel.io How to Run Specific Seeder in Laravel? - ItSolutionStuff.com PHP Error : Unparenthesized `a ? b : c ? d : e` is deprecate | Laravel.io How to chunk query results in Laravel php - How to execute a raw sql query with multiple statement with laravel - Stack Overflow
PostgreSQL POSITION() function PostgresQL ANY / SOME Operator ( IN vs ANY ) PostgreSQL Substring - Extracting a substring from a String How to add an auto-incrementing primary key to an existing table, in PostgreSQL PostgreSQL STRING_TO_ARRAY()function mysql FIND_IN_SET equivalent to postgresql PL/pgSQL Variables ( Format Dates ) The Ultimate Guide to PostgreSQL Date By Examples Data Type Formatting Functions PostgreSQL - How to calculate difference between two timestamps? | TablePlus Date/Time Functions and Operators PostgreSQL - DATEDIFF - Datetime Difference in Seconds, Days, Months, Weeks etc - SQLines CASE Statements in PostgreSQL - DataCamp SQL Optimizations in PostgreSQL: IN vs EXISTS vs ANY/ALL vs JOIN PL/pgSQL Variables PostgreSQL: Documentation: 11: CREATE PROCEDURE Reading a Postgres EXPLAIN ANALYZE Query Plan Faster PostgreSQL Counting sql - Fast way to discover the row count of a table in PostgreSQL - Stack Overflow PostgreSQL: Documentation: 9.1: tablefunc PostgreSQL DESCRIBE TABLE Quick and best way to Compare Two Tables in SQL - DWgeek.com sql - Best way to select random rows PostgreSQL - Stack Overflow How to Add a Default Value to a Column in PostgreSQL - PopSQL How to Add a Default Value to a Column in PostgreSQL - PopSQL PL/pgSQL IF Statement PostgreSQL: Documentation: 9.1: Declarations SQL Subquery - Dofactory SQL IN - SQL NOT IN - JournalDev PostgreSQL - IF Statement - GeeksforGeeks How to work with control structures in PostgreSQL stored procedures: Using IF, CASE, and LOOP statements | EDB PL/pgSQL IF Statement How to combine multiple selects in one query - Databases - ( loop reference ) DROP FUNCTION (Transact-SQL) - SQL Server | Microsoft Docs SQL : Multiple Row and Column Subqueries - w3resource PostgreSQL: Documentation: 9.5: CREATE FUNCTION PostgreSQL CREATE FUNCTION By Practical Examples datetime - PHP Sort a multidimensional array by element containing date - Stack Overflow database - Oracle order NULL LAST by default - Stack Overflow PostgreSQL: Documentation: 9.5: Modifying Tables PostgreSQL: Documentation: 14: SELECT PostgreSQL Array: The ANY and Contains trick - Postgres OnLine Journal postgresql - sql ORDER BY multiple values in specific order? - Stack Overflow sql - How to aggregate two PostgreSQL columns to an array separated by brackets - Stack Overflow How do I get the current unix timestamp from PostgreSQL? - Database Administrators Stack Exchange SQL MAX() with HAVING, WHERE, IN - w3resource linux - Which version of PostgreSQL am I running? - Stack Overflow Postgres login: How to log into a Postgresql database | alvinalexander.com Copying Data Between Tables in a Postgres Database PostgreSQL CREATE FUNCTION By Practical Examples php - How to remove all numbers from string? - Stack Overflow sql - How to get a list column names and datatypes of a table in PostgreSQL? - Stack Overflow postgresql - How do I remove all spaces from a field in a Postgres database in an update query? - Stack Overflow sql - How to get a list column names and datatypes of a table in PostgreSQL? - Stack Overflow A Step-by-Step Guide To PostgreSQL Temporary Table How to change PRIMARY KEY of an existing PostgreSQL table? · GitHub PostgreSQL UPDATE Join with A Practical Example PostgreSQL: Documentation: 15: CREATE SEQUENCE How can I drop all the tables in a PostgreSQL database? - Stack Overflow PostgreSQL Show Tables Drop tables w Dependency Tracking ( constraints ) Import CSV File Into PosgreSQL Table How To Import a CSV into a PostgreSQL Database How can I drop all the tables in a PostgreSQL database? - Stack Overflow How can I drop all the tables in a PostgreSQL database? - Stack Overflow PostgreSQL CASE Statements & Examples using WHEN-THEN, if-else and switch | DataCamp PostgreSQL LEFT: Get First N Characters in a String How can I drop all the tables in a PostgreSQL database? - Stack Overflow How can I drop all the tables in a PostgreSQL database? - Stack Overflow postgresql - Binary path in the pgAdmin preferences - Database Administrators Stack Exchange postgresql - Binary path in the pgAdmin preferences - Database Administrators Stack Exchange PostgreSQL - Copy Table - GeeksforGeeks postgresql duplicate key violates unique constraint - Stack Overflow PostgreSQL BETWEEN Query with Example VACUUM FULL - PostgreSQL wiki How To Remove Spaces Between Characters In PostgreSQL? - Database Administrators Stack Exchange sql - Postgres Query: finding values that are not numbers - Stack Overflow PostgreSQL LEFT: Get First N Characters in a String unaccent: Getting rid of umlauts, accents and special characters
כמה עוד נשאר למשלוח חינם גם לעגלה ולצקאאוט הוספת צ'קבוקס לאישור דיוור בצ'קאאוט הסתרת אפשרויות משלוח אחרות כאשר משלוח חינם זמין דילוג על מילוי כתובת במקרה שנבחרה אפשרות איסוף עצמי הוספת צ'קבוקס לאישור דיוור בצ'קאאוט שינוי האפשרויות בתפריט ה-סידור לפי בווקומרס שינוי הטקסט "אזל מהמלאי" הערה אישית לסוף עמוד העגלה הגבלת רכישה לכל המוצרים למקסימום 1 מכל מוצר קבלת שם המוצר לפי ה-ID בעזרת שורטקוד הוספת כפתור וואטסאפ לקנייה בלופ ארכיון מוצרים הפיכה של מיקוד בצ'קאאוט ללא חובה מעבר ישיר לצ'קאאוט בלחיתה על הוספה לסל (דילוג עגלה) התראה לקבלת משלוח חינם בדף עגלת הקניות גרסה 1 התראה לקבלת משלוח חינם בדף עגלת הקניות גרסה 2 קביעה של מחיר הזמנה מינימלי (מוצג בעגלה ובצ'קאאוט) העברת קוד הקופון ל-ORDER REVIEW העברת קוד הקופון ל-ORDER REVIEW Kadence WooCommerce Email Designer קביעת פונט אסיסנט לכל המייל בתוסף מוצרים שאזלו מהמלאי - יופיעו מסומנים באתר, אבל בתחתית הארכיון הוספת כפתור "קנה עכשיו" למוצרים הסתרת אפשרויות משלוח אחרות כאשר משלוח חינם זמין שיטה 2 שינוי סימן מטבע ש"ח ל-ILS להפוך סטטוס הזמנה מ"השהייה" ל"הושלם" באופן אוטומטי תצוגת הנחה באחוזים שינוי טקסט "בחר אפשרויות" במוצרים עם וריאציות חיפוש מוצר לפי מק"ט שינוי תמונת מוצר לפי וריאציה אחרי בחירה של וריאציה אחת במקרה של וריאציות מרובות הנחה קבועה לפי תפקיד בתעריף קבוע הנחה קבועה לפי תפקיד באחוזים הסרה של שדות משלוח לקבצים וירטואליים הסתרת טאבים מעמוד מוצר הצגת תגית "אזל מהמלאי" בלופ המוצרים להפוך שדות ל-לא חובה בצ'קאאוט שינוי טקסט "אזל מהמלאי" לוריאציות שינוי צבע ההודעות המובנות של ווקומרס הצגת ה-ID של קטגוריות המוצרים בעמוד הקטגוריות אזל מהמלאי- שינוי ההודעה, תגית בלופ, הודעה בדף המוצר והוספת אזל מהמלאי על וריאציה הוספת שדה מחיר ספק לדף העריכה שינוי טקסט אזל מהמלאי תמונות מוצר במאונך לצד תמונת המוצר הראשית באלמנטור הוספת כפתור קנה עכשיו לעמוד המוצר בקניה הזו חסכת XX ש''ח לאפשר למנהל חנות לנקות קאש ברוקט לאפשר רק מוצר אחד בעגלת קניות הוספת סימון אריזת מתנה ואזור להוראות בצ'קאאוט של ווקומרס הצגת הנחה במספר (גודל ההנחה) הוספת "אישור תקנון" לדף התשלום הצגת רשימת תכונות המוצר בפרונט שינוי כמות מוצרים בצ'קאאוט ביטול השדות בצ'קאאוט שינוי כותרות ופלייסהולדר של השדות בצ'קאאוט
החלפת טקסט באתר (מתאים גם לתרגום נקודתי) הסרת פונטים של גוגל מתבנית KAVA ביטול התראות במייל על עדכון וורדפרס אוטומטי הוספת תמיכה בקבצי VCF באתר (קבצי איש קשר VCARD) - חלק 1 להחריג קטגוריה מסוימת מתוצאות החיפוש שליפת תוכן של ריפיטר יצירת כפתור שיתוף למובייל זיהוי אלו אלמנטים גורמים לגלילה אופקית התקנת SMTP הגדרת טקסט חלופי לתמונות לפי שם הקובץ הוספת התאמת תוספים לגרסת WP הוספת טור ID למשתמשים הסרת כותרת בתבנית HELLO הסרת תגובות באופן גורף הרשאת SVG חילוץ החלק האחרון של כתובת העמוד הנוכחי חילוץ הסלאג של העמוד חילוץ כתובת העמוד הנוכחי מניעת יצירת תמונות מוקטנות התקנת SMTP הצגת ה-ID של קטגוריות בעמוד הקטגוריות להוריד מתפריט הניהול עמודים הוספת Favicon שונה לכל דף ודף הוספת אפשרות שכפול פוסטים ובכלל (של שמעון סביר) הסרת תגובות באופן גורף 2 בקניה הזו חסכת XX ש''ח חיפוש אלמנטים סוררים, גלישה צדית במובייל שיטה 1 לאפשר רק מוצר אחד בעגלת קניות הצגת הנחה במספר (גודל ההנחה) הוספת "אישור תקנון" לדף התשלום שינוי צבע האדמין לפי סטטוס העמוד/פוסט שינוי צבע אדמין לכולם לפי הסכמות של וורדפרס תצוגת כמות צפיות מתוך הדשבורד של וורדפרס הצגת סוג משתמש בפרונט גלילה אין סופית במדיה שפת הממשק של אלמנטור תואמת לשפת המשתמש אורך תקציר מותאם אישית
הודעת שגיאה מותאמת אישית בטפסים להפוך כל סקשן/עמודה לקליקבילית (לחיצה) - שיטה 1 להפוך כל סקשן/עמודה לקליקבילית (לחיצה) - שיטה 2 שינוי הגבלת הזיכרון בשרת הוספת לינק להורדת מסמך מהאתר במייל הנשלח ללקוח להפוך כל סקשן/עמודה לקליקבילית (לחיצה) - שיטה 3 יצירת כפתור שיתוף למובייל פתיחת דף תודה בטאב חדש בזמן שליחת טופס אלמנטור - טופס בודד בדף פתיחת דף תודה בטאב חדש בזמן שליחת טופס אלמנטור - טפסים מרובים בדף ביי ביי לאריק ג'ונס (חסימת ספאם בטפסים) זיהוי אלו אלמנטים גורמים לגלילה אופקית לייבלים מרחפים בטפסי אלמנטור יצירת אנימציה של "חדשות רצות" בג'ט (marquee) שינוי פונט באופן דינאמי בג'ט פונקציה ששולפת שדות מטא מתוך JET ומאפשרת לשים הכל בתוך שדה SELECT בטופס אלמנטור הוספת קו בין רכיבי התפריט בדסקטופ ולדציה למספרי טלפון בטפסי אלמנטור חיבור שני שדות בטופס לשדה אחד שאיבת נתון מתוך כתובת ה-URL לתוך שדה בטופס וקידוד לעברית מדיה קוורי למובייל Media Query תמונות מוצר במאונך לצד תמונת המוצר הראשית באלמנטור הצגת תאריך עברי פורמט תאריך מותאם אישית תיקון שדה תאריך בטופס אלמנטור במובייל שאיבת פרמטר מתוך הכתובת והזנתו לתוך שדה בטופס (PARAMETER, URL, INPUT) עמודות ברוחב מלא באלמנטור עמודה דביקה בתוך אלמנטור יצירת "צל" אומנותי קוד לסוויצ'ר, שני כפתורים ושני אלמנטים סקריפט לסגירת פופאפ של תפריט לאחר לחיצה על אחד העמודים הוספת כפתור קרא עוד שפת הממשק של אלמנטור תואמת לשפת המשתמש להריץ קוד JS אחרי שטופס אלמנטור נשלח בהצלחה מצב ממורכז לקרוסלת תמונות של אלמנטור לייבלים מרחפים בטפסי פלואנטפורמס
What is the fastest or most elegant way to compute a set difference using Javascript arrays? - Stack Overflow javascript - Class Binding ternary operator - Stack Overflow Class and Style Bindings — Vue.js How to remove an item from an Array in JavaScript javascript - How to create a GUID / UUID - Stack Overflow json - Remove properties from objects (JavaScript) - Stack Overflow javascript - Remove property for all objects in array - Stack Overflow convert array to dictionary javascript Code Example JavaScript: Map an array of objects to a dictionary - DEV Community JavaScript: Map an array of objects to a dictionary - DEV Community javascript - How to replace item in array? - Stack Overflow javascript - How to replace item in array? - Stack Overflow How can I replace Space with %20 in javascript? - Stack Overflow JavaScript: Check If Array Has All Elements From Another Array - Designcise javascript - How to use format() on a moment.js duration? - Stack Overflow javascript - Elegant method to generate array of random dates within two dates - Stack Overflow Compare two dates in JavaScript using moment.js - Poopcode javascript - Can ES6 template literals be substituted at runtime (or reused)? - Stack Overflow javascript - How to check if array is empty or does not exist? - Stack Overflow How To Use .map() to Iterate Through Array Items in JavaScript | DigitalOcean Check if a Value Is Object in JavaScript | Delft Stack vuejs onclick open url in new tab Code Example javascript - Trying to use fetch and pass in mode: no-cors - Stack Overflow Here are the most popular ways to make an HTTP request in JavaScript JavaScript Array Distinct(). Ever wanted to get distinct element - List of object to a Set How to get distinct values from an array of objects in JavaScript? - Stack Overflow Sorting an array by multiple criteria with vanilla JavaScript | Go Make Things javascript - Map and filter an array at the same time - Stack Overflow ecmascript 6 - JavaScript Reduce Array of objects to object dictionary - Stack Overflow javascript - Convert js Array to Dictionary/Hashmap - Stack Overflow javascript - Is there any way to use a numeric type as an object key? - Stack Overflow
Hooks Cheatsheet React Tutorial Testing Overview – React performance Animating Between Views in React | CSS-Tricks - CSS-Tricks Building an Animated Counter with React and CSS - DEV Community Animate When Element is In-View with Framer Motion | by Chad Murobayashi | JavaScript in Plain English Handling Scroll Based Animation in React (2-ways) - Ryosuke react-animate-on-scroll - npm Bring Life to Your Website | Parallax Scrolling using React and CSS - YouTube react-cool-inview: React hook to monitor an element enters or leaves the viewport (or another element) - DEV Community Improve React Performance using Lazy Loading💤 and Suspense | by Chidume Nnamdi 🔥💻🎵🎮 | Bits and Pieces Mithi's Epic React Exercises React Hooks - Understanding Component Re-renders | by Gupta Garuda | Medium reactjs - When to use useImperativeHandle, useLayoutEffect, and useDebugValue - Stack Overflow useEffect vs useLayoutEffect When to useMemo and useCallback useLockBody hook hooks React animate fade on mount How to Make a React Website with Page Transitions using Framer Motion - YouTube Build a React Image Slider Carousel from Scratch Tutorial - YouTube React Router: useParams | by Megan Lo | Geek Culture | Medium useEffect Fetch POST in React | React Tutorial Updating Arrays in State Background Images in React React Context API : A complete guide | by Pulkit Sharma | Medium Code-Splitting – React Lazy Loading React Components (with react.lazy and suspense) | by Nwose Lotanna | Bits and Pieces Lazy loading React components - LogRocket Blog Code Splitting a Redux Application | Pluralsight react.js folder structure | by Vinoth kumar | Medium react boilerplate React State Management best practices for 2021 (aka no Redux) | by Emmanuel Meric de Bellefon | Medium Create an advanced scroll lock React Hook - LogRocket Blog UseOnClickOutside : Custom hook to detect the mouse click on outside (typescript) - Hashnode react topics 8 Awesome React Hooks web-vitals: Essential metrics for a healthy site. scripts explained warnings and dependency errors Learn the useContext Hook in React - Programming with Mosh Learn useReducer Hook in React - Programming with Mosh Guide To Learn useEffect Hook in React - Programming with Mosh Getting Started With Jest - Testing is Fun - Programming with Mosh Building an accessible React Modal component - Programming with Mosh Kent C. Dodds's free React course
SAVED SEARCH DATE FORMAT(page wise) AND LOOP THROUGH EACH DATA || With Pagination || Avoids 4000 data Limt Rest in Suitlet CALL ANOTHER SCRIPT | SUITELET FROM ANY OTHER SCRIPT | SUITELET | ALSO PASSING OF PARAMETERS CALLING RESTLET |FROM SUITELET Where Is The “IF” Statement In A Saved Search Formula? – > script everything Where Is The “IF” Statement In A Saved Search Formula? – > script everything ClientScript Add Sublist Line items etc Saving Record In different way. BFO AND FREEMarkup || advance pdf html template Join In Lookup Field Search || Alternative of saved search Use Saved Serch or Lookup field search for Getting value or id of Fields not visible On UI or xml https://www.xmlvalidation.com/ XML Validate Load Record--->selectLine--->CommitLine--->Save [Set Sublist field Data After Submit] Null Check Custom Check SEND MAIL WITH FILE ATTACHED EXECUTION CONTEXT || runtime.context In BeforeLoad Use This When Trying to Get Value In BeforeLoad Convert String Into JSON Freemarker Below 2.3.31 use ?eval || above use ?eval_json Design Of Full Advance PDF Template using Suitescript PART 1: Design Of Full Advance PDF Template using Suitescript PART 2: Iterate Through Complex Nested JSON Object Freemarker || BFO || Advance PDF HTML Template WORKING JSON OBJ ITERATE FreeMarker get String convert to JSON ,Iterate through it ,Print Values In Table Series Addition Freemarker Using Loop(List) Modified Null Check || Keep Updated One Here Navigations In Netsuite || Records || etc DATE FORMAT Netsuite Javascript Transform Invoice To Credit Memo NULLCHECK Freemarker||BFO|| XML||Template Before Accessing Any Value Refresh Page Without Pop Up | | client script || Reload Page Easy Manner To Format Date || Date to simple Format || MM/DD/YYYY Format ||Simple Date CUSTOM ERROR MESSAGE CREATE HOW TO STOP MAP/REDUCE SCRIPT RUNNING FILTER ON JSON OBJECT SAVED SEARCH CRITERIA LOGIC FOR WITHIN DATE | | WITHIN START DATE END DATE TO GET Line no. also of Error NETSUITE SERVER TIMEZONE : (GMT-05:00) Eastern Time (US & Canada) || Problem resolved for Map/reduce Timezone issue for Start Date in map/reduce || RESOLVED THE ISSUE compare/check date that it lies between two dates or not || Use of .getTime() object of Date TO FIND ALL TASKS WITHIN SO START DATE AND END DATE || SAVED SEARCH CODE WORDS Saved Search Get only one Result || getRange netsuite - SuiteScript 2.0 Add filters to saved search in script - Stack Overflow || Addition in saved search filter MASS DELETE ALL RCORD FROM SAVED SEARCH DATA IN PARAMETER|| ADD SS IN THE DEPLOYMENT PARAMETER SAVED SEARCH DATE COMPARE AND GET RESULT IN DAYS HOURS MINUTES Multiple Formula Columns Comment In Saved Search || Saved search used SQL language for writing formula Logic Set Addressbook Values || Addressbook is a subrecord SuiteQL || N/Query Module || Support SQL query VALIDATE 2 DATES LIE BETWEEN 2 DATES OR NOT || OVERLAPPING CASE ALSO Weeks Within two dates:
Delete Duplication SQL Using Subquery to find salary above average Sorting Rank Number In Sql find nth Salary in SQL sql - Counting rows in the table which have 1 or more missing values - Stack Overflow How to create customized quarter based on a given date column sql sql server - Stack Overflow get total sales per quarter, every year delete duplicate for table without primary key SQL Server REPLACE Function By Practical Examples adding row_number row_id to table find total sales per cateogry each year change empty string into null values Case when to update table update table using replace function How to Use CASE WHEN With SUM() in SQL | LearnSQL.com find each year sale in each city and state, then sum them all using regexp_replace to remove special chracter postgresql find quarter sale in each state, and sum it using unbounded preceding, and using percent rank create delimiter for the phone number regexp_replace to remove special characters using row between to cummulative sum update null values using WHERE filter insert into table command sum cummulative value in SQL SQL Important syntax Auto Increment in SQL read json file on postgresql Moving Average n Moving Total pivot on potgresql Rollup and Cube date function in postgresql select specify part of string using substring change column data type exclude null values in sql how to exclude zero in our counting finding outlier in sql how to import data with identifier (primary key) email and name filtering in sql trimming and removing particular string from sql replace string on sql regexp to find string in SQL answers only about email, identifier, lower, substring, date_part, to_char find percentage of null values in total remove duplicate on both tables v2 any and in operator string function moreee bucket function find perfomance index in sql find top max and top min finding world gdp formula (SUM OVER) find month percentage change find highest height in sql with row_number and subquery JOIN AND UNION offset and limit in sql function and variables using views on postgresql find cummulative sums in postgresql find null and not null percentage find specific strings or number in SQL using case when and CAST function Lpad function in Postgresql and string function in general Regexp function in postgresql regular expressions example in postgresql And FUZZYSTRMATCH updated method of deleting duplicates determine column types
Initiate MS Team Group Chat via PowerApps Save the current users email as a variable Creates variable with a theme colour palette Send an email from the current user Filters a data source based on the current logged in user Patch data fields, including a choice column to a data source Changes the colour of a selected item in a Gallery Filter and search a data source via a search box and dropdown Changes visibility based on the selection of another Gallery - used for "Tabs" Display current users first name Fix: Combobox/Search is empty check not working - Power Platform Community Retrive a user photo from SharePoint Get user photo from office365 connector from gallery Set a variable with the current users first name, from the currentUser variable Extract values from a collection Extract value from combo box Extract vale from combo box and convert to string/text Convert collection to JSON Combo box values to collection Show newly created items first / sort by most recent entry, will only show items created today Validate/Validation text box length and/or combo boxes contain data Text input validation - turns border red Lookup value against a text input and disable or enable displaymode Lookup items from a textbox Sets items to choices drop down or combo box Change text value based on lookup results returns tops 10 results and sorts by most recent created date Sets a variable with spilt text from a link - YouTube in this case Pass a null or empty value from Power Apps to a flow
Linuxteaching | linux console browser javascript Debugging in Visual Studio Code C# - Visual Studio Marketplace C# - Visual Studio Marketplace dotnet-install scripts - .NET CLI | Microsoft Docs dotnet-install scripts - .NET CLI | Microsoft Docs undefined .NET Tutorial | Hello World in 5 minutes Configuration files – Nordic Developer Academy CacheStorage.open() - Web APIs | MDN TransIP API Install .NET Core SDK on Linux | Snap Store .NET Tutorial | Hello World in 5 minutes Creating Your First Application in Python - GeeksforGeeks Riverbank Computing | Download Managing Application Dependencies — Python Packaging User Guide Building your first mobile application using Python | Engineering Education (EngEd) Program | Section Building your first mobile application using Python | Engineering Education (EngEd) Program | Section Building your first mobile application using Python | Engineering Education (EngEd) Program | Section Building your first mobile application using Python | Engineering Education (EngEd) Program | Section ActivePython-2.7 - ActiveState - Builds - ActiveState Platform Installation guidance for SQL Server on Linux - SQL Server | Microsoft Docs Ellabusby2006/Anzelmo2022 Ik wil de PHP-versie updaten van Ubuntu / Debian | TransIP Ik wil de PHP-versie updaten van Ubuntu / Debian | TransIP W3Schools Tryit Editor .NET installeren op Debian - .NET | Microsoft Learn .NET installeren op Debian - .NET | Microsoft Learn .NET installeren op Debian - .NET | Microsoft Learn .NET installeren op Debian - .NET | Microsoft Learn How To Build A Simple Star Rating System - Simon Ugorji | Tealfeed Visual Studio Code language identifiers Running Visual Studio Code on Linux HTML Forms Installeren .NET op Debian - .NET | Microsoft Learn StarCoderEx (AI code generator) - Visual Studio Marketplace Installeren .NET op Linux zonder een pakketbeheerder te gebruiken - .NET | Microsoft Learn ASP.NET Tutorial | Hello World in 5 minutes | .NET Deploy and connect to SQL Server Linux containers - SQL Server | Microsoft Learn Settings Sync in Visual Studio Code Settings Sync in Visual Studio Code TransIP API Monitoring as Code
.NET Tutorial | Hello World in 5 minutes docx2html - npm Running Visual Studio Code on Linux Connect to an ODBC Data Source (SQL Server Import and Export Wizard) - SQL Server Integration Services (SSIS) | Microsoft Docs .NET installeren in Linux zonder pakketbeheer - .NET | Microsoft Docs TransIP API TransIP API TransIP API TransIP API .NET installeren in Alpine - .NET | Microsoft Docs .NET installeren op Ubuntu - .NET | Microsoft Docs .NET installeren op Ubuntu - .NET | Microsoft Docs Geïnstalleerde .NET-versies controleren op Windows, Linux en macOS - .NET | Microsoft Docs Install .NET Core SDK on Linux | Snap Store .NET Tutorial | Hello World in 5 minutes Riverbank Computing | Download Managing Application Dependencies — Python Packaging User Guide Building your first mobile application using Python | Engineering Education (EngEd) Program | Section Building your first mobile application using Python | Engineering Education (EngEd) Program | Section Building your first mobile application using Python | Engineering Education (EngEd) Program | Section Building your first mobile application using Python | Engineering Education (EngEd) Program | Section ActivePython-2.7 - ActiveState - Builds - ActiveState Platform html - How to get mp3 files to play in iPhone Safari web browser? - Stack Overflow Work with review data  |  Google Business Profile APIs  |  Google Developers Javascript save text file - Javascript .NET installeren op Debian - .NET | Microsoft Learn Deploy and connect to SQL Server Linux containers - SQL Server | Microsoft Learn Settings Sync in Visual Studio Code Settings Sync in Visual Studio Code
Working with JSON in Freemarker - Liferay Community Freemarker parse a String as Json - Stack Overflow Online FreeMarker Template Tester Compiler Validate XML files Convert String Into JSON Freemarker Below 2.3.31 use ?eval || above use ?eval_json Working with JSON in Freemarker - Liferay Community Working with JSON in Freemarker - Liferay Community java - Freemarker iterating over hashmap keys - Stack Overflow java - Freemarker iterating over hashmap keys - Stack Overflow FreeMarker get String convert to JSON ,Iterate through it ,Print Values In Table Online FreeMarker Template Tester || freemarker compiler Series Addition Freemarker Using Loop(List) How to Convert a string to number in freemarker template - Stack Overflow javascript - Grouping JSON by values - Stack Overflow DATE FORMAT Netsuite Javascript Freemarkup | | Iterate through nested JSON all Values Using Nested For Loop Nested JSON Iterate Using BFO javascript - Error parsing XHTML: The content of elements must consist of well-formed character data or markup - Stack Overflow NULLCHECK Freemarker||BFO|| XML||Template Before Accessing Any Value ADVANCE PDF HTML TEMPLATE 7 Tips for Becoming a Pro at NetSuite’s Advanced PDF/HTML HTML Tag Center Does Not Work in Advanced PDF/HTML Templates|| align center HTML BFO NOTES Advanced PDF/HTML Template - NetSuite (Ascendion Holdings Inc) Check Template Code Is Very Different || Bill Payment check template Check Template Code Is Very Different || Bill Payment check template Intro to NetSuite Advanced PDF Source Code Mode | Tutorial | Anchor Group NETSUITE GUIDE OVER PDF/HTML TEMPLATE EDITOR suitescript - Ability to choose between multiple PDF templates on a Netsuite transaction form - Stack Overflow BFO DIV tr td etc User Guide|| USEFULL IMPORTANT Border radius in advanced html/pdf templates is not supported? : Netsuite
001-hello-world: Hello Image Classification using OpenVINO™ toolkit 002-openvino-api: OpenVINO API tutorial 003-hello-segmentation: Introduction to Segmentation in OpenVINO 004-hello-detection: Introduction to Detection in OpenVINO 101-tensorflow-to-openvino: TensorFlow to OpenVINO Model Conversion Tutorial 102-pytorch-onnx-to-openvino: PyTorch to ONNX and OpenVINO IR Tutorial 103-paddle-onnx-to-openvino: Convert a PaddlePaddle Model to ONNX and OpenVINO IR 104-model-tools: Working with Open Model Zoo Models 210-ct-scan-live-inference: Live Inference and Benchmark CT-scan Data with OpenVINO 201-vision-monodepth: Monodepth Estimation with OpenVINO 210-ct-scan-live-inference: Live Inference and Benchmark CT-scan Data with OpenVINO 401-object-detection-webcam: Live Object Detection with OpenVINO 402-pose-estimation-webcam: Live Human Pose Estimation with OpenVINO 403-action-recognition-webcam: Human Action Recognition with OpenVINO 211-speech-to-text: Speech to Text with OpenVINO 213-question-answering: Interactive Question Answering with OpenVINO 208-optical-character-recognition: Optical Character Recognition (OCR) with OpenVINO 209-handwritten-ocr: Handwritten Chinese and Japanese OCR 405-paddle-ocr-webcam: PaddleOCR with OpenVINO 305-tensorflow-quantization-aware-training: Optimizing TensorFlow models with Neural Network Compression Framework of OpenVINO by 8-bit quantization 302-pytorch-quantization-aware-training: Optimizing PyTorch models with Neural Network Compression Framework of OpenVINO by 8-bit quantization 301-tensorflow-training-openvino: Post-Training Quantization with TensorFlow Classification Model 301-tensorflow-training-openvino: From Training to Deployment with TensorFlow and OpenVINO 204-named-entity-recognition: Named Entity Recognition with OpenVINO
If statement with switch delete duplicates from an array loop and find class Nullish with an Object - basic tranverse classes in a list substring capitalize substring text with elipses array.at() js media query Dynamic Filter - buttons advanced flow converted if statement Add an array to a HTML dataset getElement Function Intersection Observer template intersection Observer Basic Example fetch data, display and filter for of loop - get index get random index value from an array fetch with post method get id value from url debounce for scrolling get element or elements check functions return values from functions indexOf explantion sorting basic using for-of loop for getting index value of iteration import json data into a JS module Splide slider with modal JS change active class if url path matches Pagination / array of arrays FIlter array or return full array price formatting ignores wrapping element on click Create a dummy array with numbers Random Generated Number Dummy array - list items dummy id Limits the amount of text Random Number generator function format date function Remove duplicates from JSON array data Filter Posts from state remove duplicates and create object simple ternary remove transition with propertyName sorting in reverse counting items using reduce splice explanation Declaring Variables Get primitive properties on a number / string etc using proto check an array of objects exists / check using regex Destructuring nested function scope IFFE function basic switch Switch with function passing an object
Microsoft Powershell: Delete registry key or values on remote computer | vGeek - Tales from real IT system Administration environment How to Upload Files Over FTP With PowerShell Configure attack surface reduction in Microsoft Defender using Group Policy or PowerShell – 4sysops WinPE: Create bootable media | Microsoft Learn powershell - Can I get the correct date mixing Get-Date and [DateTime]::FromFileTime - Stack Overflow Search-ADAccount (ActiveDirectory) | Microsoft Docs Manual Package Download - PowerShell | Microsoft Docs Get a List of Expired User Accounts in AD Using PowerShell Search-ADAccount (ActiveDirectory) | Microsoft Docs How to Stop an Unresponsive Hyper-V Virtual Machine | Petri IT Knowledgebase Adding PowerShell 7 to WinPE - Deployment Research Send-MailMessage (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Learn How to run a PowerShell script as a Windows service – 4sysops Connect to Exchange Online with PowerShell - The Best Method Find the Full Windows Build Number with PowerShell How to find all the ADFS servers in your environment and run diagnostics against them | Michael de Blok How to find ADFS servers in the environment - Windows Server path - PowerShell script working directory (current location) - Stack Overflow How to get the path of the currently executing script in PowerShell [SOLVED] Unable to Delete Hyper-V VM Checkpoints - Spiceworks Published Applications – Carl Stalhood VMM Reporting | Aidan Finn, IT Pro Use PowerShell to search for string in registry keys and values - Stack Overflow Search for Uninstall Strings - Jose Espitia
INCOME AND SPEND SUMMARY: Monthly regular gift income (DD, CC, PayPal) INCOME AND SPEND SO AGENCT AND PAYROLL INCOME AND SPEND Non Monthly DD income INCOME AND SPEND SUMMARY Donation (50020) Income and Spend Summary Appeal (50050) INCOME AND SPEND SUMMARY:FAV Donation (50060) INCOME AND SPEND SUMMARY: In Memory Of (IMO) (50170) INCOME AND SPEND SUMMARY: Single Fundraised Sales (51040)+Books(51050) INCOME AND SPEND SUMMARY: Single Fundraised Sales (51040)+Books(51050) INCOME AND SPEND SUMMARY: Single Fundraised Sales (51040)+Books(51050) INCOME AND SPEND SUMMARY: Single Fundraised Sales (51040)+Books(51050) INCOME AND SPEND SUMMARY: Raffle ticket sales INCOME AND SPEND SUMMARY:51060 - Community Fundraising INCOME AND SPEND SUMMARY:50130 - Collecting Tins INCOME AND SPEND SUMMARY:50110 - Gift Aid REGULAR GIVING SUMMARY: Monthly regular gift payments CC/PP/DD SINGLE GIFT SUMMARY: Single gift payments (donations only) NEW SUPPORTER INCOME: Single gift payments NEW SUPPORTER INCOME: Monthly regular gift income NEW SUPPORTER INCOME: New monthly regular gifts established (new supporters only) NEW SUPPORTER INCOME: Single gift income (new supporters only) EXISTING BASE: INCOME FROM EXISTING REGULAR INSTRUCTIONS EXISTING BASE Monthly regular gift payments (CC/PP/DD) EXISTING BASE: Existing Non monthly DD income Existing Base other regular giving income EXISTINGBASE Cumulative monthly regular gift payments EXISTING BASE Monthly regular gift income from new regular donor EXISTING BASE single gift donations income - existing supporters EXISTING BASE Single gift donations EXISTING BASE: Single gift income - high value gifts Existing Base: Workplace giving income EXISTING BASE Volunteer fundraising & other cash income (Community Events, FB fundraiser, Lilo) EXISTING BASE: Gift aid income ES ES Monthly cc/pp/dd Income existing ES ES Monthly cc/pp/dd Payments existing Single Single gift under 500 Total Regular giving Existing WORKPLACE GIVING
Windows: 7/Vista/XP/2K tcp tunneling nbtscan: Multiple-OS command line utility: NETBIOS nameserver scanner Linux: Simulating slow internet connection Linux/Ubuntu: Changing gateway address and flush/restart network interface Linux: SSH Tunnel to local machines. Linux: Get my external ip address Linux/Ubuntu: Enable/Disable ping response Linux: Cron: Reset neorouter Linux/Ubuntu: sniff tcp communications (binary output) Liunux/Ubuntu: get a list of apps that are consuming bandwidth Linux/Ubuntu: iptables: block external outgoing ip address Linux/Ubuntu: How to setup pptp vpn server Linux: NGINX: Setup alias Linux: ssh without password Linux: NGINX: Proxy reverse Linux: one way remote sync using unison and ssh Linux: Open ssh port access using a combination (knocking technique) Linux: ssh login for only one user Linux/Ubuntu: Server: Configuring proxies Linux/Ubuntu: Share folder with Windows (via samba) Linux: Get all my local IP addresses (IPv4) Linux/Ubuntu: list ufw firewall rules without enabling it Linux/Ubuntu: Connect windows to shared folder as guest Linux/Ubuntu: Avoid connection from specific ip address without using iptables Linux: Telegram: Send telegram message to channel when user logged via ssh Linux/Ubuntu: nginx: Configuration to send request to another server by servername Modbus/ModPoll Linux/Neorouter: watchdog for neorouter connection Linux: libgdcm: Send dicom images to PACS using gdcmscu. Ubuntu: mount full rw cifs share Linux/Ubuntu: NGINX: Basic authentication access Linux/Ubuntu: Mosquitto: Enable mqtt service Linux: Detect if port is closed from command line Linux: Get internet content from command line using wget Mac OSX: Port redirection Windows 10: Port redirection/Tunneling Python: Telegram Bot API: Ask/Answer question PHP: Post a XML File using PHP without cURL Nginx: Call php without extension PHP: Send compressed data to be used on Javascript (i.e. Json data) PHP: Download file and detect user connection aborted Linux/Proxmox: Enable /dev/net/tun for hamachi PHP: using curl for get and post NGINX: Creating .htpasswd
Linux: Free unused cache memory Linux: mounting VirtualBox VDI disk using qemu nbtscan: Multiple-OS command line utility: NETBIOS nameserver scanner Linux: Saving one or more webpages to pdf file Linux: Creating iso image from disk using one line bash command Linux/PostgreSQL: Getting service uptime Linux: Simulating slow internet connection Linux/Ubuntu: Changing gateway address and flush/restart network interface Linux: SSH Tunnel to local machines. Linux: Fast find text in specific files using wild cards Linux: Merging two or more pdf files into one, by using ghostscript Linux: Cron command for deleting old files (older than n days) Linux: Get my external ip address Linux: Get the size of a folder Linux: Get the size of a folder Linux: Get the size of a folder Lazarus/Linux: Connect to SQLServer using ZeosLib component TZConnection Linux/Ubuntu: Get ordered list of all installed packages Linux/Ubuntu: Enable/Disable ping response Linux/DICOM: Very small DICOM Server Linux: Cron: Reset neorouter Linux/Oracle: Startup script Linux/Ubuntu: detect if CD/DVD disk ispresent and is writeable Linux/PHP: Let www-data run other commands (permission) Linux/DICOM: Create DICOM Video Linux: Apply same command for multiple files Linux/Ubuntu: sniff tcp communications (binary output) Linux: rsync: Backup remote folder into local folder Linux: Installing Conquest Dicom Server Linux: Get number of pages of PDF document via command line Linux: split file into pieces and join pieces again Linux/Ubuntu: iptables: block external incoming ip address Liunux/Ubuntu: get a list of apps that are consuming bandwidth Linux/Ubuntu: iptables: block external outgoing ip address Linux/DICOM: dcmtk: Modify data in dicom folder Linux/Docker: save/load container using tgz file (tar.gz) Linx/Ubuntu: solve problem apt-get when proxy authentication is required Docker: Clean all Linux: ImageMagick: convert first page of pdf document to small jpeg preview Linux: Convert pdf to html PostgreSQL: backup/restore remote database with pg_dump Linux/Ubuntu: How to setup pptp vpn server Linux/Xubuntu: Solve HDMI disconnection caused by non-supported resolution Linux: List all users PostgreSQL: Log all queries Linux: NGINX: Setup alias Linux: ssh without password Linux: NGINX: Proxy reverse Linux: one way remote sync using unison and ssh Linux: Deleting files keeping only lastest n-files in specific folder Linux: Open ssh port access using a combination (knocking technique) Linux: Get Memory percentages. Linux: Can not sudo, unkown user root (solution) Linux: PDF: How to control pdf file size Linux: ssh login for only one user Linux: get pid of process who launch another process Linux: PHP: Fix pm.max server reached max children Linux/Ubuntu: Server: Configuring proxies Linux: Compare two files displaying differences Sox: Managing audio recording and playing Linux: VirtualBox: Explore VDI disk without running virtualbox Linux: Get machine unique ID Linux: rsync only files earlier than N days Linux: Create Virtual Filesystem Linux/Ubuntu: Server: Add disks to lvm Python/Ubuntu: connect to sqlserver and oracle Linux/Ubuntu: Share folder with Windows (via samba) Linux: Get all my local IP addresses (IPv4) Linux/Ubuntu: list ufw firewall rules without enabling it Linux/Ubuntu: Connect windows to shared folder as guest Linux: delete tons of files from folder with one command Linux/Ubuntu: Avoid connection from specific ip address without using iptables Linux: Telegram: Send telegram message to channel when user logged via ssh Linux/Ubuntu: Create barcode from command line. Linux: PHP/Python: Install python dependencies for python scripts and run scripts form php Linux/Ubuntu: nginx: Configuration to send request to another server by servername Linux/Ubuntu: Fix Imagemagick "not authorized" exception Linux/Neorouter: watchdog for neorouter connection Linux: libgdcm: Send dicom images to PACS using gdcmscu. Ubuntu: mount full rw cifs share Linux/Ubuntu: NGINX: Basic authentication access PostgreSQL: Backup/Restore database from/to postgres docker. Linux/Ubuntu: Mosquitto: Enable mqtt service Linux/PHP: Connect php7.0 with sqlserver using pdo. Linux: Detect if port is closed from command line Linux: PHP: Run shell command without waiting for output (untested) Linux/Ubuntu: OS Installation date Linux/Ubuntu: Join pdf files from command line using pdftk Linux: Get internet content from command line using wget Linux/PHP/SQL: Ubuntu/Php/Sybase: Connecting sysbase database with php7 Linux/Ubuntu: Solve LC_ALL file not found error Linux/Ubuntu: Run window program with wine headless on server Linux/Docker: List ip addresses of all containers. Linux: sysmon script (memory usage) Linux: Firebird: Create admin user from command line Linux/Firebird: Backup/Restore database Git: Update folder linux/dfm-to-json/docker Linux/Oracle/Docker: 19c-ee Linux/Docker: SQL Server in docker Linux/PHP/Docker: Run docker command from php/web Linux/Docker: Oracle 12-ee docker Linux: Oracle: Backup using expdp Linux/PHP/NGINX: Increase timeout Lazarus/Fastreport: Install on Linux Linux/Ubuntu: fswatch: watch file changes in folder Linux/Docker: SQL Server 2019 in docker Linux/Docker: SQLServer: mssql-scripter: backup/restore Linux/Ubuntu: Enable/disable screensaver Linux: SQLServer: Detect MDF version Linux/Docker: Oracle install 19c (II) on docker FirebirdSQL: Restore/Backup Linux/NGINX: Redirect to another server/port by domain name Linux/Proxmox: Enable /dev/net/tun for hamachi Linux/Ubuntu: Create sudoer user Linux: PDF-url to text without downloading pdf file Docker: Reset logs
Linux/PostgreSQL: Getting service uptime Lazarus/Linux: Connect to SQLServer using ZeosLib component TZConnection Linux/Oracle: Startup script PostgreSQL: backup/restore remote database with pg_dump PostgreSQL: Log all queries PostgreSQL: Create DBLINK PostgreSQL: Database replication Python/Ubuntu: connect to sqlserver and oracle Oracle/SQL: Generate range of dates PostgreSQL: Convert records to json string and revert to records PostgreSQL: Extract function DDL PostgreSQL: Backup/Restore database from/to postgres docker. Linux/PHP: Connect php7.0 with sqlserver using pdo. PostgreSQL: Trigger template PostgreSQL: Count all records in spite of using offset/limit PHP/SQL: Reverse SQL Order in sentence PostgreSQL: Filter using ilike and string with spaces PostgreSQL: Create log table and trigger Postgres: Get string all matches between {} Linux/PHP/SQL: Ubuntu/Php/Sybase: Connecting sysbase database with php7 PostgreSQL: Must know PostgreSQL: Debito, Credito, Saldo PostgreSQL: Count total rows when range is empty PostgreSQL: Extremely fast text search using tsvector PostgreSQL: Create a copy of DB in same host PHP/PostgreSQL: Event Listener Linux: Firebird: Create admin user from command line SQL: CTE Parent-child recursive Windows/Docker/Firebird: Backup remote database Linux/Firebird: Backup/Restore database PostgreSQL: Set search path (schemas) for user Firebird on Docker Firebird: Find holes in sequence (missing number) Linux/Oracle/Docker: 19c-ee Firebird: Create an Array of integers from String Oracle: Change Sys/System user pasword Oracle: Create/drop tablespace Oracle: Create User/Schema Linux: Oracle: Backup using expdp Linux/Docker: SQL Server 2019 in docker Oracle: Get slow queries Linux: SQLServer: Detect MDF version Linux/Docker: Oracle install 19c (II) on docker FirebirdSQL: Restore/Backup Firebird: Age Calculation using Ymd format Postgresql: Age calculation to Ymd Firebird: Create Range of dates, fraction in days, hours, minutes, months or years Firebird: DATE_TO_CHAR Function (like Oracle's TO_CHAR) MS SQLServer Backup Database MS SQLServer: Detect long duration SQL sentences Firebird: Fast Search Firebird: Code Generator FirebirdSQL 2.x: DATE_TO_CHAR Procedure (like Oracle's TO_CHAR) MSSQLServer: Sequences using Date based prefix format
CSS: Setup a perfect wallpaper using background image CSS: Ellipsis at end of long string in element Javascript: Is my browser on line? CSS: Crossbrowser blur effect Javascript: calculating similarity % between two string Javascript: vanilla and crossbrowser event handler accepting arguments Javascript: convert native browser event to jQuery event. Linux: Convert pdf to html Javascript: Convert proper name to Capital/Title Case Javascript: Disable Back Button - (untested) HTML/CSS: Login Page HTML/CSS: Circular progress bar using css HTML/CSS: Data column organized as top-down-right structure HTML/CSS: Printing page in letter size Javascript: Get file name from fullpath. HTML/CSS: Header/Body/Footer layout using flex Windows: Chrome: Avoid prompt on custom url calling by changing registry Javascript: Get filename and path from full path filename Javascript: Clone array/object. CSS + FontAwesome: Battery charging animation CSS: spin element HTML/CSS: Switch with input CSS: Transparent event clicks having translucid front div element CSS: Blurry Glass Effect CSS: Grow element size when mouse hover Javascript/jQuery: Input with fixed prefix. Javascript: ProtocolCheck Javascript: Beep Telegram: Chat/html (personal) PHP: php-imagick: Thumbnail from thispersondoesnotexists Javascript: Get host info Javascript: Vanilla async get HTML/CSS: Rotating circle loader PHP: Post JSON object to API without curl Javascript: Post data to new window. CSS/Android Ripple Effect in Pure CSS OSRM/API: OpenStreet Maps Calculate distance between points OSM/OpenLayers: Place marker on coordinates using custom image. PHP: Send compressed data to be used on Javascript (i.e. Json data) PHP/JSignature: Base30 to PNG Javascript: Query Params to JSON Javascript/CSS: Ripple Effect - Vanilla Delphi/UniGUI: Disable load animation PHP: Send basic authentication credentials Delphi: Post JSON to API PHP: Receiving Bearer Authorization token from header Linux/NGINX: Redirect to another server/port by domain name Javascript: Async/Await Web Programming: Fastest way for appending DOM elements CSS: Animated progress bar CSS: Shake element CSS: Align elements like windows explorer icons layout style Javascript: Submit JSON object from form values Javascript: Fetch POST JSON Linux: PDF-url to text without downloading pdf file Javascript/in Browser: Jump to anchor Javascript/NodeJS: Uglify js files CSS: Two of the best readable fonts in web CSS: Dark/Theater background Javascript: Detect inactivity / idle time Svelte: Dynamic component rendering CSS: Responsive Grid NGINX: Creating .htpasswd Javascript: Wait until all rendered Javascript: Print PDF directly having URL Sveltekit: Create component dynamically Sveltekit: Create component dynamically Sveltekit: Import component dynamically CSS: Animation/Gelatine
substr(): It takes two arguments, the starting index and number of characters to slice. substring(): It takes two arguments, the starting index and the stopping index but it doesn't include the character at the stopping index. split(): The split method splits a string at a specified place. includes(): It takes a substring argument and it checks if substring argument exists in the string. includes() returns a boolean. If a substring exist in a string, it returns true, otherwise it returns false. replace(): takes as a parameter the old substring and a new substring. replace(): takes as a parameter the old substring and a new substring. charAt(): Takes index and it returns the value at that index indexOf(): Takes a substring and if the substring exists in a string it returns the first position of the substring if does not exist it returns -1 lastIndexOf(): Takes a substring and if the substring exists in a string it returns the last position of the substring if it does not exist it returns -1 concat(): it takes many substrings and joins them. startsWith: it takes a substring as an argument and it checks if the string starts with that specified substring. It returns a boolean(true or false). endsWith: it takes a substring as an argument and it checks if the string ends with that specified substring. It returns a boolean(true or false). search: it takes a substring as an argument and it returns the index of the first match. The search value can be a string or a regular expression pattern. match: it takes a substring or regular expression pattern as an argument and it returns an array if there is match if not it returns null. Let us see how a regular expression pattern looks like. It starts with / sign and ends with / sign. repeat(): it takes a number as argument and it returns the repeated version of the string. Concatenating array using concat indexOf:To check if an item exist in an array. If it exists it returns the index else it returns -1. lastIndexOf: It gives the position of the last item in the array. If it exist, it returns the index else it returns -1. includes:To check if an item exist in an array. If it exist it returns the true else it returns false. Array.isArray:To check if the data type is an array toString:Converts array to string join: It is used to join the elements of the array, the argument we passed in the join method will be joined in the array and return as a string. By default, it joins with a comma, but we can pass different string parameter which can be joined between the items. Slice: To cut out a multiple items in range. It takes two parameters:starting and ending position. It doesn't include the ending position. Splice: It takes three parameters:Starting position, number of times to be removed and number of items to be added. Push: adding item in the end. To add item to the end of an existing array we use the push method. pop: Removing item in the end shift: Removing one array element in the beginning of the array. unshift: Adding array element in the beginning of the array. for of loop Unlimited number of parameters in regular function Unlimited number of parameters in arrow function Expression functions are anonymous functions. After we create a function without a name and we assign it to a variable. To return a value from the function we should call the variable. Self invoking functions are anonymous functions which do not need to be called to return a value. Arrow Function Object.assign: To copy an object without modifying the original object Object.keys: To get the keys or properties of an object as an array Object.values:To get values of an object as an array Object.entries:To get the keys and values in an array hasOwnProperty: To check if a specific key or property exist in an object forEach: Iterate an array elements. We use forEach only with arrays. It takes a callback function with elements, index parameter and array itself. The index and the array optional. map: Iterate an array elements and modify the array elements. It takes a callback function with elements, index , array parameter and return a new array. Filter: Filter out items which full fill filtering conditions and return a new array reduce: Reduce takes a callback function. The call back function takes accumulator, current, and optional initial value as a parameter and returns a single value. It is a good practice to define an initial value for the accumulator value. If we do not specify this parameter, by default accumulator will get array first value. If our array is an empty array, then Javascript will throw an error every: Check if all the elements are similar in one aspect. It returns boolean find: Return the first element which satisfies the condition findIndex: Return the position of the first element which satisfies the condition some: Check if some of the elements are similar in one aspect. It returns boolean sort: The sort methods arranges the array elements either ascending or descending order. By default, the sort() method sorts values as strings.This works well for string array items but not for numbers. If number values are sorted as strings and it give us wrong result. Sort method modify the original array. use a compare call back function inside the sort method, which return a negative, zero or positive. Whenever we sort objects in an array, we use the object key to compare. Destructing Arrays : If we like to skip on of the values in the array we use additional comma. The comma helps to omit the value at that specific index
openssh GitLab.com / GitLab Infrastructure Team / next.gitlab.com · GitLab Use Apple touch icon | webhint documentation How to get GPU Rasterization How to get GPU Rasterization Migrating to Manifest V3 - Chrome Developers Migrating to Manifest V3 - Chrome Developers Manifest - Web Accessible Resources - Chrome Developers chrome.webRequest - Chrome Developers chrome.webRequest - Chrome Developers Cross-site scripting – Wikipedia Cross-site scripting – Wikipedia Cross-site scripting – Wikipedia Cross-site scripting – Wikipedia Cross-site scripting – Wikipedia Cross-site scripting – Wikipedia Export-ModuleMember (Microsoft.PowerShell.Core) - PowerShell | Microsoft Learn Sourcegraph GraphQL API - Sourcegraph docs Winge19/vscode-abl: An extension for VS Code which provides support for the Progress OpenEdge ABL language. https://marketplace.visualstudio.com/items?itemName=chriscamicas.openedge-abl Winge19/vscode-abl: An extension for VS Code which provides support for the Progress OpenEdge ABL language. https://marketplace.visualstudio.com/items?itemName=chriscamicas.openedge-abl Winge19/vscode-abl: An extension for VS Code which provides support for the Progress OpenEdge ABL language. https://marketplace.visualstudio.com/items?itemName=chriscamicas.openedge-abl New File Cache · Actions · GitHub Marketplace Cache · Actions · GitHub Marketplace Winge19/cache: Cache dependencies and build outputs in GitHub Actions Winge19/cache: Cache dependencies and build outputs in GitHub Actions Winge19/cache: Cache dependencies and build outputs in GitHub Actions Winge19/cache: Cache dependencies and build outputs in GitHub Actions Winge19/cache: Cache dependencies and build outputs in GitHub Actions history.state during a bfcache traversal · web-platform-tests/wpt@7d60342 Configure CI/CD pipeline with YAML file - MSIX | Microsoft Learn Configure CI/CD pipeline with YAML file - MSIX | Microsoft Learn Configure CI/CD pipeline with YAML file - MSIX | Microsoft Learn Configure CI/CD pipeline with YAML file - MSIX | Microsoft Learn Configure CI/CD pipeline with YAML file - MSIX | Microsoft Learn Configure CI/CD pipeline with YAML file - MSIX | Microsoft Learn Configure CI/CD pipeline with YAML file - MSIX | Microsoft Learn Configure CI/CD pipeline with YAML file - MSIX | Microsoft Learn Configure CI/CD pipeline with YAML file - MSIX | Microsoft Learn ASP.NET Core 6.0 Blazor Server APP and Working with MySQL DB - CodeProject json Process Herpaderping – Windows Defender Evasion | Pentest Laboratories 0x7c13/Notepads: A modern, lightweight text editor with a minimalist design. Share data - UWP applications | Microsoft Learn What is ie_to_edge_bho_64.dll? What is ie_to_edge_bho_64.dll? What is ie_to_edge_bho_64.dll? What is ie_to_edge_bho_64.dll? Message passing - Chrome Developers
parsing - Parse (split) a string in C++ using string delimiter (standard C++) - Stack Overflow parsing - Parse (split) a string in C++ using string delimiter (standard C++) - Stack Overflow parsing - Parse (split) a string in C++ using string delimiter (standard C++) - Stack Overflow parsing - Parse (split) a string in C++ using string delimiter (standard C++) - Stack Overflow arrays - Convert a hexadecimal to a float and viceversa in C - Stack Overflow arrays - Convert a hexadecimal to a float and viceversa in C - Stack Overflow Why does C++ require breaks in switch statements? - Stack Overflow Why does C++ require breaks in switch statements? - Stack Overflow Why does C++ require breaks in switch statements? - Stack Overflow coding style - Switch statement fall-through...should it be allowed? - Stack Overflow performance - Convert a hexadecimal string to an integer efficiently in C? - Stack Overflow C,C++ ---结构体指针初始化_zlQ_的博客-CSDN博客_c++初始化结构体指针 c++ - C++ 返回局部变量的常引用 - SegmentFault 思否 (23条消息) C++ 去掉const_最后冰吻free的博客-CSDN博客_c++ 去掉const (23条消息) 尾置返回值类型decltype_最后冰吻free的博客-CSDN博客 (23条消息) 变参模板函数_最后冰吻free的博客-CSDN博客_变参模板 (23条消息) 变参表达式_最后冰吻free的博客-CSDN博客 (23条消息) 变参下标_最后冰吻free的博客-CSDN博客 (23条消息) 变参基类_最后冰吻free的博客-CSDN博客 (23条消息) typname 使用_最后冰吻free的博客-CSDN博客 (23条消息) 零初始化_最后冰吻free的博客-CSDN博客 (23条消息) this->使用_最后冰吻free的博客-CSDN博客 (23条消息) 变量模板_最后冰吻free的博客-CSDN博客_变量模板 (23条消息) enable_if使用_最后冰吻free的博客-CSDN博客 (23条消息) 完美转发函数_最后冰吻free的博客-CSDN博客 (23条消息) C++ 函数返回局部变量地址和引用_最后冰吻free的博客-CSDN博客_c++函数返回地址 (23条消息) C++ 函数返回局部变量地址和引用_最后冰吻free的博客-CSDN博客_c++函数返回地址 (23条消息) C++ 函数返回局部变量地址和引用_最后冰吻free的博客-CSDN博客_c++函数返回地址 结构体数组定义时初始化 cJSON的数据结构 C++共用体与结构体区别-C++ union与struct的区别-嗨客网 C++共用体与结构体区别-C++ union与struct的区别-嗨客网 队列的c语言实现_51CTO博客_c语言实现队列 栈的实现 c语言版_51CTO博客_c语言栈的实现以及操作 【专业技术】如何写出优美的C 代码? - 腾讯云开发者社区-腾讯云 【专业技术】如何写出优美的C 代码? - 腾讯云开发者社区-腾讯云 C++ short-C++短整型-C++ short取值范围-嗨客网 C++ short-C++短整型-C++ short取值范围-嗨客网 C++ long long-C++长长整型-C++ long long取值范围-嗨客网 C++ long long-C++长长整型-C++ long long取值范围-嗨客网 C++字符-C++ char-C++字符取值范围-嗨客网 C++枚举enum-C++怎么定义枚举变量-C++枚举的作用-嗨客网 C++三目运算符-C++的三目运算符-C++三目运算符怎么用-什么是三目运算符-嗨客网 C++打印乘法表-嗨客网 C++ while循环打印乘法表-嗨客网 C++ do while循环打印乘法表-嗨客网 (转)sizeof()和_countof()区别 - 榕树下的愿望 - 博客园 详述CRC校验码(附代码)-面包板社区 详述CRC校验码(附代码)-面包板社区 详述CRC校验码(附代码)-面包板社区 C program to convert Hexadecimal to Decimal - Aticleworld Conversion of Hex decimal to integer value using C language (27条消息) vector<char>太慢,自己造一个CharVector_char vector_飞鸟真人的博客-CSDN博客 C++ windows显示器相关信息获取 - 艺文笔记
Q64 Snapshot Array - LeetCode Q63 Reorganize String - LeetCode Q62 Tricky Sorting Cost | Practice | GeeksforGeeks Q62 Minimum Cost To Connect Sticks Q60 PepCoding | Longest Substring With At Most Two Distinct Characters Q59 PepCoding | Line Reflection Q58 Pairs of Non Coinciding Points | Practice | GeeksforGeeks Q57 Avoid Flood in The City - LeetCode Q56 Random Pick with Blacklist - LeetCode Q55 Insert Delete GetRandom O(1) - Duplicates allowed - LeetCode Q55 Insert Delete GetRandom O(1) - Duplicates allowed - LeetCode Q54 Insert Delete GetRandom O(1) - LeetCode Q53 The Skyline Problem - LeetCode Q52 Encode and Decode TinyURL - LeetCode Q51 Maximum Frequency Stack - LeetCode Q50 Brick Wall - LeetCode Q50 Brick Wall - LeetCode Q49 X of a Kind in a Deck of Cards - LeetCode Q48 First Unique Character in a String - LeetCode Q47 Subdomain Visit Count - LeetCode Q46 Powerful Integers - LeetCode Q45 4Sum II - LeetCode Q44 PepCoding | Quadruplet Sum QFind K Pairs with Smallest Sums - LeetCode Q43 PepCoding | Pairs With Given Sum In Two Sorted Matrices Q42 Completing tasks | Practice | GeeksforGeeks Q41 Degree of an Array - LeetCode Q-40 Can Make Arithmetic Progression From Sequence - LeetCode Q39 PepCoding | Double Pair Array Q38 Rabbits in Forest - LeetCode Q-37* Fraction to Recurring Decimal - LeetCode Q36 PepCoding | Pairs With Equal Sum Q35 PepCoding | Count Of Subarrays With Equal Number Of 0s 1s And 2s Q34 PepCoding | Longest Subarray With Equal Number Of 0s 1s And 2s Q-34PepCoding | Pairs With Equal Sum Q33 PepCoding | Count Of Subarrays With Equal Number Of Zeroes And Ones Q32 Contiguous Array - LeetCode Q31 Subarray Sums Divisible by K - LeetCode Q30 PepCoding | Longest Subarray With Sum Divisible By K Q29 Subarray Sum Equals K - LeetCode Q27 Word Pattern - LeetCode Q-26 Isomorphic Strings - LeetCode Q-25 PepCoding | Group Shifted String Q24 Group Anagrams - LeetCode Q23 Valid Anagram - LeetCode Q22 PepCoding | Find Anagram Mappings Q21 PepCoding | K Anagrams Q20 Find All Anagrams in a String - LeetCode Q-19 Binary String With Substrings Representing 1 To N - LeetCode Q-18 PepCoding | Count Of Substrings Having At Most K Unique Characters Q-17 PepCoding | Longest Substring With At Most K Unique Characters Q-16 PepCoding | Maximum Consecutive Ones - 2 Q15 PepCoding | Maximum Consecutive Ones - 1 Q-14 PepCoding | Equivalent Subarrays Q13 PepCoding | Count Of Substrings With Exactly K Unique Characters Q-12 PepCoding | Longest Substring With Exactly K Unique Characters Q-11 PepCoding | Count Of Substrings Having All Unique Characters Q-10 PepCoding | Longest Substring With Non Repeating Characters Q-9 PepCoding | Smallest Substring Of A String Containing All Unique Characters Of Itself Q8 PepCoding | Smallest Substring Of A String Containing All Characters Of Another String | leetcode76 Q-7 PepCoding | Largest Subarray With Contiguous Elements Q-6 PepCoding | Count Of All Subarrays With Zero Sum Q5 PepCoding | Largest Subarray With Zero Sum Q4 PepCoding | Count Distinct Elements In Every Window Of Size K Q-3 PepCoding | Check If An Array Can Be Divided Into Pairs Whose Sum Is Divisible By K Q2 PepCoding | Find Itinerary From Tickets Q1 PepCoding | Number Of Employees Under Every Manager 2653. Sliding Subarray Beauty
DSA 1.8 : Pointers DSA-1.8 : Pointers DSA-1.8 : Pointers DSA 1.8 : Pointers DSA 1.10 : Reference DSA 1.12 - Pointer to structure DSA 1.12 - pointer to structure DSA 1.15 : Paramter passing method : by value DSA 1.15 : Parameter passing method- by address DSA 1.15 : parameter passing method -by reference DSA 1.18 : returning array from a function DSA 1.20 : pointer to structure DSA 1.23 : monolithic program DSA 1.24 : procedural or modular programming DSA 1.25 : procedural programming using structure and functions DSA 1.26 : Object Oriented programming approach DSA 1.30 : template classes DSA 5.52 Recursion using static variable DSA 5.56 : tree recursion DSA 5.58 : Indirect recursion DSA 5.56 : Nested recursion DSA 5.68 : Taylor series using recursion DSA 5.70 : Taylors series using Horner's rule DSA 5.73 : Fibonacci using iteration DSA 5.73 : Fibonacci using recursion DSA 5.73 : Fibonacci using memoization and recursion DSA 5.75 : nCr using recursion DSA 5.76 : Tower of Hanoi DSA 7 : array ADT DSA 7.99 - Delete function in an array DSA 7.102 : Linear Search DSA 146 : C++ class for Diagonal matrix DSA 150 : Lower Triangular matrix Diagonal matrix full code Creation of sparse matrix 175. Display for linked list 176. Recursive display for linked list 178 : counting nodes in a linked list 179: sum of all elements in a linked list 181: find the largest element in the linked list 183: searching for a value in linked list 184: Improve searching in a linked list 186: Inserting a new node in a linked list (logic) 186: Insertion in a linked list (function) 189: Creating a linked list by inserting at end 191: Inserting in a sorted linked list 192: deleting a node from a linked list 195 : check if the linked list is sorted or not 197: Remove duplicates from sorted linked list
Q66 Distinct Echo Substrings - LeetCode 1316 (rabin karp rolling hash -> O(n^2)) Q66 Distinct Echo Substrings - LeetCode 1316(O(n^3) solution) Q65 Interleaving String - LeetCode 97 Q64 Frog Jump - LeetCode 403 Q63 Champagne Tower - LeetCode 799 Q62 Super Ugly Number - LeetCode 313 Q61 Ugly Number 2 - LeetCode 264 Q60 Minimum Insertion Steps to Make a String Palindrome - LeetCode 1316 Q59 Temple Offerings | Practice | GeeksforGeeks Q58 Word Break - LeetCode 139 Q57 Arithmetic Slices II - Subsequence - LeetCode 446 Q56 Arithmetic Slices - LeetCode 413 Q55 Max sum of M non-overlapping subarrays of size K - GeeksforGeeks (tabulization) Q55 Max sum of M non-overlapping subarrays of size K - GeeksforGeeks (memoization) Q54 Maximum Sum of 3 Non-Overlapping Subarrays - LeetCode 689 Q53 Maximum Sum of Two Non-Overlapping Subarrays - LeetCode 1031 Q52 Maximum difference of zeros and ones in binary string | Practice | GeeksforGeeks Q51 Mobile numeric keypad | Practice | GeeksforGeeks Q50 Distinct Transformation LeetCode Playground ( tabulization approach) Q50 - Distinct Transformation- LeetCode Playground ( recursion + memoization approach) Q49 Highway BillBoards - Coding Ninjas Codestudio approach 2 Q49 Highway BillBoards - Coding Ninjas Codestudio (approach 1 LIS) Q48 Knight Probability in Chessboard - LeetCode 688 Q47 Cherry Pickup - LeetCode 741 (recursion approach) Q46 Super Egg Drop - LeetCode 887 Q45 Predict the Winner - LeetCode 486 Q45 Optimal Strategy For A Game | Practice | GeeksforGeeks | leetcode 46 Q44 Largest Sum Subarray of Size at least K | Practice | GeeksforGeeks Q42 Maximum Subarray - LeetCode 53 Q41 Minimum Cost To Make Two Strings Identical | Practice | GeeksforGeeks Q40 Minimum ASCII Delete Sum for Two Strings - LeetCode 712 Q39 Scramble String - LeetCode 87 Q38 Edit Distance - LeetCode 72 Q37 Regular Expression Matching - LeetCode 10 Q36 Wildcard Matching - LeetCode Q35 Longest Repeating Subsequence | Practice | GeeksforGeeks Q34 Longest Common Substring | Practice | GeeksforGeeks Q33 Count Different Palindromic Subsequences - LeetCode 730 Q32 Number of distinct subsequences | Practice | GeeksforGeeks Q31 Longest Palindromic Substring - LeetCode Q30 Count Palindromic Subsequences | Practice | GeeksforGeeks Q29 Longest Palindromic Subsequence - LeetCode 516 Q28 Longest Common Subsequence - LeetCode 1143 Q27 Minimum Score Triangulation of Polygon - LeetCode 1039 Q26 Optimal binary search tree | Practice | GeeksforGeeks Q24 Matrix Chain Multiplication | Practice | GeeksforGeeks Q23 Palindrome Partitioning II - LeetCode 132 Q23 Palindrome Partitioning II - LeetCode - 132 ( n^3 approach) Q22 Palindromic Substrings - LeetCode 647 Q21 Rod Cutting | Practice | GeeksforGeeks Q20 Minimum Score Triangulation of Polygon - LeetCode 1039 Q19 Intersecting Chords in a Circle | Interviewbit Q18 Generate Parentheses - LeetCode 22 Q17 PepCoding | Count Of Valleys And Mountains Q16 Unique Binary Search Trees - LeetCode 96 Q15 Catalan Number Minimum Score of a Path Between Two Cities - 2492 Q14 Perfect Squares - LeetCode Q13 Russian Doll Envelopes - LeetCode (LIS in NlogN - accepted solution) Q13 Russian Doll Envelopes - LeetCode 354 solution1(LIS in O(n^2)) Q12 PepCoding | Maximum Non-overlapping Bridges Q11 Longest Bitonic subsequence | Practice | GeeksforGeeks Q10 Maximum sum increasing subsequence | Practice | GeeksforGeeks Q9 PepCoding | Print All Longest Increasing Subsequences Q8 Longest Increasing Subsequence - LeetCode 300 Q7 2 Keys Keyboard - LeetCode 650 Q-6 PepCoding | Print All Results In 0-1 Knapsack Q5 PepCoding | Print All Paths With Target Sum Subset Q4 PepCoding | Print All Paths With Maximum Gold Q3 PepCoding | Print All Paths With Minimum Cost Q2 Jump Game II - LeetCode 45 Q1 Maximal Square - LeetCode 221 Q67 Longest Increasing Subsequence - LeetCode 300 ( LIS O(nlogn) solution) Q43 K-Concatenation Maximum Sum - LeetCode 1191 Q13 Russian Doll Envelopes - LeetCode 354 ( LIS -> O(nlogn) solution) Q25 Burst Balloons - LeetCode 312
Minimum Score of a Path Between Two Cities - 2492 Number of Operations to Make Network Connected - 1319 Q42 Mother Vertex | Interviewbit (kosraju) Q41 Count Strongly Connected Components (Kosaraju’s Algorithm) Q40 Leetcode 734. Sentence Similarity Q39 Satisfiability of Equality Equations - LeetCode 990 Q38 Redundant Connection II - LeetCode 685 Q37 Redundant Connection - LeetCode 684 Q36 Minimize Malware Spread II - LeetCode 928 Q35 Minimize Malware Spread - LeetCode 924 Q34 Accounts Merge - LeetCode 721 Q33 Minimize Hamming Distance After Swap Operations - LeetCode 1722 Q32 Rank Transform of a Matrix - LeetCode 1632 Q32 Reconstruct Itinerary - leetcode 332 (eularian path && Eularian cycle) Q31 Regions Cut By Slashes - LeetCode 959 Q30 Minimum Spanning Tree | Practice | GeeksforGeeks (kruskal algo) Q29 Number of Islands II - Coding Ninjas (DSU) Q28 Remove Max Number of Edges to Keep Graph Fully Traversable - LeetCode 1579 Q27 Checking Existence of Edge Length Limited Paths - LeetCode 1675 Q26 Network Delay Time - LeetCode 743 Q25 Cheapest Flights Within K Stops - LeetCode 787 Q24 Distance from the Source (Bellman-Ford Algorithm) | Practice | GeeksforGeeks Q23 Connecting Cities With Minimum Cost - Coding Ninjas Q22 Swim in Rising Water - LeetCode 778 Q21 Water Supply In A Village - Coding Ninjas Q20 Minimum Spanning Tree | Practice | GeeksforGeeks(prims algo) Q19 Alien Dictionary | Practice | GeeksforGeeks Q18 Course Schedule - LeetCode 207 (kahn's algorithm) Q17 Minimum edges(0-1 BFS) | Practice | GeeksforGeeks Q17 Minimum edges(0-1 BFS) | Practice | GeeksforGeeks ( using djikstra) Q16 Sliding Puzzle - LeetCode 773 Q15 Bus Routes - LeetCode 815 Q14 Shortest Bridge - LeetCode 934 (without pair class) Q14 Shortest Bridge - LeetCode 934 ( with pair class) Q 13 As Far from Land as Possible - LeetCode 1120 Q12 Rotting Oranges - LeetCode 994 Q11 01 Matrix - LeetCode 542 Q10 Number of Distinct Islands | Practice | GeeksforGeeks Q9 Number of Enclaves - LeetCode 1085 Q8 Coloring A Border - LeetCode 1034 Q7 Unique Paths II - 63 Q6 Unique Paths III - LeetCode 980 Q5 Number of Provinces - LeetCode 547 Q4 Number of Islands - LeetCode 200 Q3 Number of Operations to Make Network Connected - LeetCode 1319 Q2 All Paths From Source to Target - LeetCode 797 Q1 Find if Path Exists in Graph - LeetCode 1971 Q43 is Cycle present in DAG ? GFG ( Topological Sort) Q43 is cycle present in DAG ? GFG (using kahns algo) Q44 Bellman ford | GFG ( Smaller code) Q45 Minimum Cost to Make at Least One Valid Path in a Grid - LeetCode 1368
chapter2-code-1 chapter2-code-2 chapter2-code-3 chapter3-code-1 chapter4-code-1 chapter4-code-2 chapter4-code-3 chapter4-code-4 chapter4-code-5 chapter4-code-6 chapter4-code-7 chapter4-code-8 chapter4-code-9 chapter4-code-10 chapter5-code-1 chapter5-code-2 chapter5-code-3 chapter6-code-1 chapter6-code-2 chapter6-code-3 chapter7-code-1 chapter7-code-2 chapter7-code-3 chapter7-code-4 chapter7-code-5 chapter7-code-6 chapter7-code-7 chapter7-code-8 chapter7-code-9 chapter7-code-10 chapter7-code-11 chapter7-code-12 chapter7-code-13 chapter8-code-1 chapter8-code-2 chapter8-code-3 chapter8-code-4 chapter9-code-1 chapter9-code-2 chapter9-code-3 chapter9-code-4 chapter10-code-1 chapter10-code-2 chapter10-code-3 chapter10-code-4 chapter10-code-5 chapter11-code-1 chapter11-code2 chapter11-code-3 chapter11-code-4 chapter11-code-5 chapter11-code-6 chapter12-code-1 chapter12-code-2 chapter13-code-1 chapter13-code-2 chapter13-code-3 chapter13-code-4 chapter13-code-5 chapter14-code-1 chapter14-code-2 chapter14-code-3 chapter14-code-4 chapter15-code-1 chapter15-code-2 chapter16-code-1 chapter16-code-2 chapter16-code-3 chapter16-code-4 chapter16-code-5 chapter16-code-6 chapter16-code-7 chapter16-code-8 chapter16-code-9 chapter16-code-10 chapter17-code-1 chapter17-code-2 chapter18-code-1 chapter18-code-2 chapter18-code-3 chapter18-code-4 chapter18-code-5 chapter19-code-1 chapter19-code-2 chapter19-code-3 chapter20-code-1 chapter21-code-1 chapter21-code-2 chapter21-code-3 chapter21-code-4 chapter21-code-5 chapter22-code-1 chapter22-code-2 chapter22-code-3 chapter23-code-1 chapter23-code-2 chapter23-code-3 chapter23-code-4 chapter23-code-5 chapter24-code-1 chapter24-code-2 chapter24-code-3 chapter25-code-1 chapter25-code-2 chapter25-code-3 chapter25-code-4 chapter25-code-5 chapter25-code-6 chapter25-code-7 chapter25-code-8 chapter25-code-9 chapter26-code-1 chapter26-code-2 chapter27-code-1 chapter27-code-2 chapter28-code-1 chapter28-code-2 chapter29-code-1 chapter11-code-2 chapter1-code-1
Display Custom Post By Custom Texonomy Hide Section If Data Empty Custom post Url Change Social Share Link Genrator / meta tag OG Set Custom post type template Custom post by current category page List all Category Loop Reverse Reverse Array in custom repeat fields Display custom texonomy name into post WP Rocket Delay JavaScript execution Files Post FIlter By Texonomy URL Check and echo active exclude current post from single page Post Sort by Custom Taxonomy in Admin Ajex select change texonomy and post Wordpress Ajex select Get Category Name (wp get object()) List Display Custom Taxonomy Order Date Woocommerce Disable notification for plugin update Custom Ajax Form for WP Order Expiry Woocommerce Post By Post Taxonomy Hide Section If Data Empty Product SKU Search with default search Hide WP Version Disable REST API Get Post Data with Post or page id (WCK CTP Select field) Custom API For Page with custom fields Disable WordPress Update Notifications Create Users Automatically In WordPress / create admin login Create and Diplsay ACF Texonomy Data Custom Post by Custom Texo filter JQuery Multiple Select Filter WordPress Premium Plugins Repo WP Premium Plugins Repo Part 2 Custom Taxonomy Template Post Order by ASC and DESC on published date Post Order by ASC and DESC on published date Widget Register and Dipslay Display category and Subcategory with Post CF7 Successful Submit Redirect to another page Load Fancybox on page load Once in month with cookies SVG Support in WP in function.php List Custom Taxonomy Wordpress Admin Login Page Layout Change Change Posts To Blogs (Post Type) JQuery Load More Display Custom Post under custom taxonomy Search Form with result page Stater Theme style.css file Acf option page Call Another Custom Header Zoho Integration for cf7 Forms www redirection 404 WP Template Coming Soon HTML Template Display Custom Posts by Category With Ajax filter Disable wordpress update notification / wp update notification custom breadcrumbs Disable admin toolbar except admin Disable Comment module on whole website Custom Data / Product / Card Filter by page load (by get and isset function) Mastek Resource Page for filter data List All pages on admin dashboard Custom Taxonomy Name on Single Page custom texonomy list with child WordPress Security and admin page Code Js Load on Page Based
Prints I love python Opens a comic in webbrowser YouTube video downloader GUI in Python A Simple Text Editor In Python CTk Login Form GUI in Python A Word Guessing Game In Python A GUI Password Manager With Database Connectivity in Python Word Counter In Python An Adventure Game GUI In Python A Basic Browser In Python Using PyQt5 (This doesn't store your browsing history!) Speech command Bot (Doraemon) In Python To-Do List Interface(With Lottie) In Python To-Do List Interface(With Lottie) In Python: HTML Code Rock Paper Scissors GUI In Python Rock Paper Scissors GUI In Python: The GUI code Your Motivator With Python And Unsplash Dice Stimulator Python CTk GUI A PNG to WEBP Converter With Python Mini Calculator GUI with Python A Number-Guessing Game In Python A Random Wikipedia Article Generator GUI In Python Your Own Gallery In Python A Tic Tac Toe Game In Python AI Weather Predictor That Doesn't Predict The Weather A Real-Time Spelling Checker In Python How to make a simple button in customtkinter Button like one on my website in python CTk How to make a simple checkbox in customtkinter python Hobby Selector Using Python CustomTkinter A sample comment in Python Python hub challenge 1 Single line comment in Python Multi line comments in Python Inline comments in Python Demonstrating Integers in Python Demonstrating Boolean numbers in Python Demonstrating Float numbers in Python Demonstrating Complex numbers in Python challenge 2 solution (numbers in python) Implicit type conversion in python Explicit type conversion python part 1 Explicit type conversion in python part 2 String formatting in Python String Concatenation in Python String formatting using print function Python Format function in Python % operator string formatting in Python F-String in Python How to utilize variables in string's solution string indexing python String Slicing question String Slicing question2 String Slicing question3 String Slicing question4 String Slicing question5 String Slicing Answer 1 String Slicing Answer 2 String Slicing Answer 3 String Slicing Answer 4 String Slicing Answer 5 String part 2 challenge solution Madlib in Python (solution) Madlib in Python (solution) output Madlib in Python (solution) 2 Madlib in Python (solution) output 2 Dictionary challenge solution Dictionary challenge solution output Single value tuple Python Single value tuple Python output Concatenate tuples in Python Copy a tuple in Python count() method tuple python index() method tuple python Tuple challenge Tuple challenge output Creating a set in Python Fun world Dictionary challenge Fun world Dictionary Output If else statement Elif ladder Multiple if statements Python Nested if else statements Python if else comprehension Simple calculator in python (if else challenge) Simple calculator in python (if else challenge) Output Iterating through list in Python Iterating through list in Python using For loop Break statement in Python Continue statement in Python Pass statement in Python Else with for loop in Python
9. Write a C program that prints the English alphabet (a-z). 10. Write a C program that prints both the Max and Min value in an array 1. Write a C program that takes a character from the user and prints its corresponding ASCII value 2. Write a C program, which reads an integer and checks whether the number is divisible by both 5 and 6, or neither of them, of just one of them. 4. Write a C program that checks if a number is prime or not. 5. Write a C program that stores an integer code in a variable called ‘code’. It then prompts the user to enter an integer from the standard input, which we will compare with our original ‘code’. If it matches the code, print ‘Password cracked’, otherwise, prompt the user to try again. For example, int code = 23421; //23421 is the code here. 6. Based on question 5, modify the program to keep track of the number of attempted password guesses. It then prints: “The password was cracked after ‘n’ amount of tries”, n being the tracking variable. Bonus Questions: 1. What is the difference between a while loop and a do-while loop? 2. Is the size of an Array mutable after declaration? 3. What is the purpose of passing the address of a variable in scanf? 4. What are the various possible return values for scanf? 5. Why do we declare the main method as an int function with return 0 at the end? 7. Write a C program that prompts the User to initialize an array by providing its length, and its values. It then asks him to enter the ‘focal number’. Your task is to print all the values in the array that are greater than the ‘focal number’. 8. Write a C program that prompts the user to enter 10 positive numbers and calculates the sum of the numbers.
Q12 Maximum Path Sum in the matrix - Coding Ninjas (Striver DP) Q- Recursion | Memoization | Tabulization in 2d dp READ ME Q18 Partitions with Given Difference | Practice | GeeksforGeeks Q17 Perfect Sum Problem | Practice | GeeksforGeeks Q16 Minimum sum partition | Practice | GeeksforGeeks Q52 Boolean Evaluation - Coding Ninjas Q-49 Matrix Chain Multiplication - Coding Ninjas Q24 Rod Cutting | Practice | GeeksforGeeks Q23 Knapsack with Duplicate Items | Practice | GeeksforGeeks Q-19 0 - 1 Knapsack Problem | Practice | GeeksforGeeks Q14 Subset Sum Equal To K - Coding Ninjas Q14 Cherry Pickup - Coding Ninjas Q-8 Ninja’s Training - Coding Ninjas Q-6 Maximum sum of non-adjacent elements - Coding Ninjas Q-3 Frog Jump - Coding Ninjas Q55 Count Square Submatrices with All Ones - LeetCode 1277 Q55 Maximal Rectangle - LeetCode 85 Q54 Partition Array for Maximum Sum - LeetCode1043 Q53 Palindrome Partitioning II - LeetCode 132 Q51 Burst Balloons - LeetCode 312 Q50 Minimum Cost to Cut a Stick - LeetCode 1547 Q47 Number of Longest Increasing Subsequence - LeetCode 673 Q45 Longest String Chain - LeetCode 1048 Q44 Largest Divisible Subset - LeetCode 368 Q43 Longest Increasing Subsequence - LeetCode 300 Q34 Wildcard Matching - LeetCode 44 Q33 Edit Distance - LeetCode 72 Q-32 Distinct Subsequences - LeetCode 115 Q25 Longest Common Subsequence - LeetCode 1143 Q22 Coin Change II - LeetCode 518 Q-20 Coin Change - LeetCode 322 Q-15 Target Sum - LeetCode 494 Q-12 Triangle - LeetCode 120 Q11 Minimum Path Sum - LeetCode 64 Q-10 Unique Paths II - LeetCode Q-9 Unique Paths - LeetCode 62 Q-6 House Robber II - LeetCode 213 Q-5 House Robber - LeetCode 198 Q-1 Climbing Stairs - LeetCode 70
8. Write a C program function that uses pointers to swap to numbers. 6. Write a C program that prints the English alphabet using pointers. 10. Write a C program void function that uses pointers to perform decompose operation. (Print only in the main function). Decompose means breaking up a decimal number into an integer part and a double part and storing them in different variables. 1. Write a C program function called ‘changeEven’ that changes all the even numbers within an array to 0, using pointer arithmetic 2. Write a C program function called ‘changePrime’, that changes all the prime numbers within an array to 0. Use another function, within ‘changePrime, called ‘checkPrime’, to check and return whether the number is prime or not, then update the value in the ‘changePrime’ accordingly. Don’t use pointer arithmetic 3. Write a C program that sorts an Array in descending order. 4. Write a C program function called ‘factorial’ that calculates and returns the factorial of a number. 5. Write a C program that gets an Array with 10 3-digits integer IDs. The program then prompts the user to enter his ID, which will be compared to the existing IDs within our Array. If his ID is matched, print “Accepted”, else print “Unaccepted”. 7. Write a C program that accepts three integers: a, b, and c, and prints them in ascending order 9. After the holidays lots of people were rushing to move back to their apartments. In this scenario, even numbers will represent women while odd numbers will represent men. Store the sequence of entry into the building by typing in even and odd numbers into an array at random. Calculate the largest sequence of women entering the building before a man enters. (The largest continuous number of women that entered before a man came in) Example: 17, 4, 6, 8, 9, 2, 8, 49 (The largest continuous number of women is 3).
Write a loop that reads positive integers from console input, printing out those values that are greater than 100, and that terminates when it reads an integer that is not positive. The printed values should be separated by single blank spaces. Declare any variables that are needed. Write a loop that reads positive integers from console input, printing out those values that are even, separating them with spaces, and that terminates when it reads an integer that is not positive. Write a loop that reads positive integers from console input and that terminates when it reads an integer that is not positive. After the loop terminates, it prints out the sum of all the even integers read. Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have already been declared, use a while loop to compute the sum of the cubes of the first n counting numbers, and store this value in total. Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total. Use no variables other than n, k, and total. Do not modify n. Don't forget to initialize k and total with appropriate values. loop design strategies Given a char variable c that has already been declared, write some code that repeatedly reads a value from console input into c until at last a 'Y' or 'y' or 'N' or 'n' has been entered. Given a string variable s that has already been declared, write some code that repeatedly reads a value from console input into s until at last a "Y" or "y" or "N" or "n" has been entered. Write a loop that reads strings from console input where the string is either "duck" or "goose". The loop terminates when "goose" is read in. After the loop, your code should print out the number of "duck" strings that were read. Objects of the BankAccount class require a name (string) and a social security number (string) be specified (in that order) upon creation. Declare an object named account, of type BankAccount, using the values "John Smith" and "123-45-6789" as the name and social security number respectively.
components-of-robot Difference in Robot System and AI Programs How does the computer vision contribute in robotics? Goals of Artificial Intelligence four Categories of AI What is searching?What are the different parameters used to evaluate the search technique? Uninformed Search Algorithms First-Order Logic Inference rule in First-Order Logic What are different branches of artificial intelligence? Discuss some of the branches and progress made in their fields. What is adversarial search? Write the steps for game problem formulation. State and explain minimax algorithm with tic-tac-toe game. Explain the role of Intelligent Agent in AI. Also explain all types of intelligent agents in details. Explain PEAS. Write the PEAS description of the task environment for an automated car driving system. Define the role of the machine intelligence in the human life Describe arguments in multiagent systems and its types. negotiation and bargining Explain information retrieval with its characteristics. What is information extraction ? What do you mean by natural language processing ? Why it is needed? What are the applications of natural language processing? What are the various steps in natural language processing Machine translation What are the three major approaches of machine translation ? Forward Chaining AND Backward Chaining with properties Difference between Forwarding Chaining and Backward Chaining: knowledge representation Explain unification algorithm used for reasoning under predicate logic with an example. State Space Search in Artificial Intelligence Explain about the hill climbing algorithm with its drawback and how it can be overcome ? What is the heuristic function? min max algorithm Describe alpha-beta pruning and give the other modifications to the Min-Max procedure to improve its performance.