Skip to content

Instantly share code, notes, and snippets.

View khomutoff's full-sized avatar

Dmitriy Khomutov khomutoff

  • Redmond, WA USA
View GitHub Profile
Param(
[Parameter(Mandatory = $false)]
[String[]]
$SubscriptionIds
)
#Log in to Azure account
if ([string]::IsNullOrEmpty($(Get-AzContext).Account)) { Connect-AzAccount } else { Write-Host "Already logged in" }
#Get the list of Azure Subscription ID's
class Solution:
# Given a sorted array, remove the duplicates in place such that each element can appear atmost twice and return the new length.
# @param A : list of integers
# @return an integer
def removeDuplicates(self, A):
if len(A) < 2:
return len(A)
index = 0
while index < (len(A)):
if A[index] == A[index - 2]:
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param A : head node of linked list
# @return the first node in the cycle in the linked list
def detectCycle(self, A):
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param A : head node of linked list
# @return the head node in the linked list
def deleteDuplicates(self, A):