This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
# Update package list and install necessary packages | |
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils build-essential sudo git | |
# Create the 'docker' user, set password, and add the user to the sudo group using 'usermod' | |
RUN useradd -m docker && echo "docker:docker" | chpasswd && usermod -aG sudo docker | |
# Switch to the 'docker' user | |
USER docker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Definition for singly-linked list. | |
* struct ListNode { | |
* int val; | |
* ListNode *next; | |
* ListNode() : val(0), next(nullptr) {} | |
* ListNode(int x) : val(x), next(nullptr) {} | |
* ListNode(int x, ListNode *next) : val(x), next(next) {} | |
* }; | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example [1,2,4,6,3,7,8] Output: 5 | |
We know Sum of first n natural numbers = n ( n+1) / 2 | |
All the numbers are distinct starting from 1 and are in range 1 to n | |
int findMissingNumber(int A[], int n) { | |
int i = 0 | |
for (int j = 0; j<A.length ; j++){ | |
i = i + A[j] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------- | |
Walking Trance, marching into | |
Disparte from ambient and adobe | |
Hazy lightning, chaotic sound | |
envelopes a tensy frigid place | |
Head Held high , perceives the other end | |
Chalky stools, forsaken and steeped | |
Tiptoed at the niche, bleakly and moist | |
Dissimilitude from the swamp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sometimes, easing anxiety means realizing not every thought or feeling has a deeper meaning. | |
Some are just visitors passing through. We often assign our ow | |
n meanings to things and allow them become our trut |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(igraph) | |
library(ggplot2) | |
library(dplyr) | |
read.csv("socidataset.csv") -> a | |
ggplot(aes(Sign),data=a)+geom_bar(fill=c("Red","Green"))+labs(title="Trust and Distrust") | |
sort(table(a$X..FromNodeId),decreasing=T)[1:10] -> Top | |
barplot(Top,space = 0.5,main = "Nodes Having highest out Degree") | |
sort(table(a$ToNodeId),decreasing=T)[1:10] -> L2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import combinations | |
Mutate=[] | |
for Value1,Value2 in list(combinations(Listing),r=2): | |
nums=numpy.random.choice([0,1],size=34) | |
Tupple=[Value1[i] if nums[i]==0 else Value2[i] for i in range(len(nums))] | |
Mutate.append(Tupple) | |
Listing2=[] | |
for j in Mutate: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* package whatever; // don't place package name! */ | |
import java.util.*; | |
import java.lang.*; | |
import java.io.*; | |
/* Name of the class has to be "Main" only if the class is public. */ | |
class Ideone | |
{ | |