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
| void main() { | |
| List<int> nos = [1, 2, 23, 5, 12, 8, 7]; | |
| int largest1 = nos[0]; | |
| int largest2 = nos[0]; | |
| void solution1() { | |
| for (var i = 0; i < nos.length; i++) { | |
| int current = nos[i]; |
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
| sudo rm -rf "/Library/Application Support/Paragon Software/" | |
| sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist | |
| sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist | |
| sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist | |
| sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist | |
| sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/ | |
| sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer | |
| sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/ | |
| sudo rm -rf /Library/PreferencePanes/ParagonNTFS.prefPane |
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
| // Check for Balanced Brackets in an expression (well-formedness) | |
| // Input: exp = “[()]{}{[()()]()}” Output: Balanced | |
| // Input: exp = “[(])” Output: Not Balanced | |
| void main() { | |
| final stringChecker = StringChecker1(); | |
| // final result = stringChecker.isValid("{([])}"); ///true | |
| // final result = stringChecker.isValid("()[]{}"); ///true | |
| final result = stringChecker.isValid("(]"); ///false | |
| print("String is well-formed: $result"); |
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
| /// Single Responsibility Principle /// | |
| /// A class should only be responsible for one thing that means | |
| /// a class should change for only one reason. | |
| void main() { | |
| final result = ResultBeforeSRP(); | |
| //final result = ResultAfterSRP(); | |
| result.checkResult(10); | |
| } |
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
| void main() { | |
| //write a program to print prime nos from 1 to n | |
| //Note: prime number is only divisible by 1 and itself. | |
| int no = 50; | |
| // check for the every number from 1 to no | |
| for (int i = 1; i <= no; i++) { | |
| if (isPrime(i)) { | |
| print("$i"); | |
| } |
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
| void main() { | |
| // Given the a list of unique numbers sorted in ascending order, | |
| // return a new list so that the values increment by 1 for each index from | |
| // the minimum value up to the maximum value (both included). | |
| // Example | |
| // Input: 1,3,5,6,7,8 | |
| // Output: 1,2,3,4,5,6,7,8 | |
| String pipeFix1(List<int> numbers) { | |
| String output = ''; |
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
| void main() { | |
| // print the fibonnaci series upto n number | |
| // Example: n = 10 | |
| // Output: 0,1,1,2,3,5,8,13,21 | |
| int num1 = 0; | |
| int num2 = 1; | |
| int sum = 0; | |
| int count = 10; | |
| List<int> fibSeries = []; |
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
| void main() { | |
| // Given a positive integer n, calculate the following sum: | |
| // n + n/2 + n/4 + n/8 + ... | |
| // All elements of the sum are the results of integer division. | |
| // Example | |
| // 25 => 25 + 12 + 6 + 3 + 1 = 47 | |
| int no = 25; | |
| int sum = 25; |
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
| import 'dart:math'; | |
| void main() { | |
| //Given nums = [2, 7, 11, 15], target = 18. | |
| //The output should be [1, 2]. | |
| //Because nums[1] + nums[2] = 7 + 11 = 18. | |
| final nums = [2, 7, 11, 15]; | |
| int target = 18; |