This file contains 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
Intent - Although existing zen mode works good. 1hr of max zen time does no good and extending zen mode to higher time interval will just lock user out from using the device which is against the whole purpose of mobile usage. So instead of treating the mobile as addiction for users, lets make it as a weapon to crub procastination. Zen mode does not mean keeping phone down, mobile can be used in most productive way too. For example a user might ought to read ebooks from Amazon kindle app during 9-10pm everyday and between that time they need no disturbance. Reading news in morning via google news/any other news app in morning. | |
This by allowing users to access specific user defined apps in zen mode. So kindof making the zen environment where user controls which app should they able to access for zen period | |
Feature - Zen mode with profiles aka Zen garden or Zen environment | |
Description - | |
- Users should be able to define the duration of custom zen period. Which can be max upto 1week | |
- Users should be able to ad |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics.CodeAnalysis; | |
using System.Linq; | |
public class Solution | |
{ | |
public class ListBak | |
{ |
This file contains 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
using System; | |
using System.Collections.Generic; | |
public class Program { | |
public class ListArrayComparer: IComparer<int[]> | |
{ | |
public int Compare(int[] a, int[] b) | |
{ | |
if(a[0] < b[0]) |
This file contains 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
using System; | |
using System.Collections.Generic; | |
public class Program { | |
public static List<int> SpiralTraverse(int[,] array) { | |
var traverseList = new List<int>(); | |
int rowCounter = 0; | |
int ColumnCounter = 0; | |
This file contains 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
using System; | |
public class Program { | |
public int[] ArrayOfProducts(int[] array) { | |
int allProduct = 1; | |
int zeroCounter = 0; | |
int[] productArray = new int[array.Length]; | |
This file contains 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
using System; | |
using System.Collections.Generic; | |
public class Program { | |
public int BinaryTreeDiameter(BinaryTree tree) { | |
List<BinaryTree> queue = new List<BinaryTree>(); | |
queue.Add(tree); | |
int index = 0; | |
int longestDiameter = -1; |
This file contains 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
public class Solution { | |
public int[] CountBits(int n) { | |
if(n == 0) return new int[]{ 0 }; | |
int[] output = new int[n + 1]; | |
output[0] = 0; | |
output[1] = 1; | |
for(int i = 2; i < output.Length; i++) | |
{ |
This file contains 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
// https://leetcode.com/problems/divisor-game/ | |
public class Solution { | |
public enum Player { Alice = 1, Bob= 2 } | |
private const int X = 1; | |
public bool DivisorGame(int n) { | |
return WhoLooses(Player.Alice, n) != Player.Alice; | |
} | |
This file contains 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
// https://leetcode.com/problems/pascals-triangle/submissions/ | |
public class Solution { | |
public IList<IList<int>> Generate(int numRows) { | |
return PascalTriangle(numRows - 1,numRows - 1).Cast<IList<int>>().ToList(); | |
} | |
public List<List<int>> PascalTriangle(int row, int columns) | |
{ | |
if(row == 0) |
This file contains 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
// https://leetcode.com/problems/pascals-triangle-ii/ | |
public class Solution { | |
public IList<int> GetRow(int rowIndex) { | |
return PascalTriangle2(rowIndex); | |
} | |
public List<int> PascalTriangle2(int row) | |
{ | |
if(row == 0) | |
return new List<int>() { 1 }; |
OlderNewer