Skip to content

Instantly share code, notes, and snippets.

View adnan-SM's full-sized avatar

Adnan A M adnan-SM

  • Bangalore, India
View GitHub Profile
@adnan-SM
adnan-SM / LongestSubstring.java
Created April 29, 2020 06:43
Longest Substring Problem
class NoRepeatSubstring {
public static int findLength(String str) {
int windowStart = 0, maxLength = 0;
Map<Character, Integer> charIndexMap = new HashMap<>();
// try to extend the range [windowStart, windowEnd]
for (int windowEnd = 0; windowEnd < str.length(); windowEnd++) {
char rightChar = str.charAt(windowEnd);
// if the map already contains the 'rightChar', shrink the window from the beginning so that
// we have only one occurrence of 'rightChar'
if (charIndexMap.containsKey(rightChar)) {
@adnan-SM
adnan-SM / AddNumbers.java
Created April 29, 2020 06:42
Add Numbers
class Solution {
public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
return addNumbersHelper(l1, l2, 0);
}
public ListNode addNumbersHelper(ListNode l1, ListNode l2, int carry) {
if(l1 == null && l2 == null && carry == 0) {
/*
* Copyright 2014 Johannes Homeier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
{
"Action On Incoming" : "{\n \"cancelButtonLabel\" : \"Cancel\",\n \"setNewActionConfigLabel\" : \"Set New Action Configuration\",\n \"action1DescriptionLabel\" : \"(e.g. Existing contact sends you sms, you can create case or task using that sms automatically)\",\n \"action2Label\" : \" Action 2 : If senders mobile number is unknown\",\n \"createTaskLabel\" : \"Create Task\",\n \"actionOnIncomingTitleLabel\" : \"Create new action on incoming SMS\",\n \"nameLabel\" : \"Name\",\n \"createCaseLabel\" : \"Create Case\",\n \"createOpportunityLabel\" : \"Create Opportunity\",\n \"saveButtonLabel\" : \"Save\",\n \"doNothingLabel\" : \"Do Nothing\",\n \"createContactLabel\" : \"Create Contact\",\n \"configureActionDescriptionLabel\" : \"When Incoming SMS is received in your org, You can configure following actions,\",\n \"action1Label\" : \"Action 1: If senders mobile number is already stored in some Objects Record\",\n \"helpLabel\" : \"Help for this page ?\",\n \"createLeadLabel\" : \"Create Lead