Skip to content

Instantly share code, notes, and snippets.

class StackQueue{
Stack<int> st1 = new Stack<int>();
Stack<int> st2 = new Stack<int>();
//Complete the functions
public void Push(int x){
while(st2.Count>0){
st1.Push(st2.Pop());
}
st1.Push(x);
public bool isAnagram(string a, string b)
{
if(a.Length != b.Length){
return false;
}
//Your code here
var aDict = new Dictionary<char,int>();
var bDict = new Dictionary<char,int>();
var aArr = a.ToCharArray();
var bArr = b.ToCharArray();
public int findPlatform(int[] arr, int[] dep,int n)
{
//code here
Array.Sort(arr);
Array.Sort(dep);
var noOfPlatforms = 0;
var i = 0;
var j = 0;
public int majorityElement(int[] a, int size)
{
//code here
var majorElement = -1;
var majorElementCount = new Dictionary<int,int>();
for (int i = 0;i<size;i++){
if(majorElementCount.ContainsKey(a[i])){
ls | Rename-Item -NewName {$_.name -replace "OLD-FILE-NAME-PART","NEW-FILE-NAME-PART"}
#copying
Write-Host "Copying charts.."
Copy-Item "sorceaddress" -Destination "destaddress" -Recurse
$todayDate = Get-Date -UFormat "%Y%m%d"
#rename file
Rename-Item sourcefile.CSV newname.CSV
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
Table can be dropped even when there is a view on it. There is no warning.
The associated view just becomes invalid when underlying table is dropped. 
Solution is to create a view "WITH SCHEMABINDING" option, which will give a warning, if there is any change in underlying table.
robocopy source destination /MOVE (delete from source) /E (all sub dirs and files)
let userRValue = toastr.warning("This query name already exists. Query will be saved as name_copy. <br /><button type='button' value='yes' class='btn clear'>Yes</button><button type='button' value='no' >No</button>",
'Are you sure to continue?',
{
allowHtml: true,
timeOut: 0,
extendedTimeOut: 0,
onclick: function (toast) {
let userResponseValue = toast.target.value;
if (userResponseValue == 'yes') {
console.log(toast.target.value, 'carai');
$targetDir= "C:\data"
get-ChildItem $targetDir | select name | OUT-File "C:\log\files.txt"