Skip to content

Instantly share code, notes, and snippets.

View ervinod's full-sized avatar

Vinod Patil ervinod

  • Napses Technologies, Banglore
  • Banglore, IN
  • 23:58 (UTC +05:30)
  • LinkedIn in/iamvinod
View GitHub Profile
@ervinod
ervinod / main.dart
Created January 27, 2025 18:49
Find the second largest number of the array list
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];
@ervinod
ervinod / reset paragon ntfs for mac trial
Created January 1, 2024 17:19
reset paragon ntfs for mac trial
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
@ervinod
ervinod / main.dart
Created October 9, 2023 11:55
problem-6
// 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");
@ervinod
ervinod / main.dart
Last active October 9, 2023 12:01
single-responsibility-principle
/// 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);
}
@ervinod
ervinod / main.dart
Last active August 9, 2023 04:24
problem-5
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");
}
@ervinod
ervinod / main.dart
Created August 1, 2023 16:57
problem-4
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 = '';
@ervinod
ervinod / main.dart
Last active August 1, 2023 17:01
problem-3
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 = [];
@ervinod
ervinod / main.dart
Created August 1, 2023 15:30
problem-2
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;
@ervinod
ervinod / main.dart
Last active August 1, 2023 15:18
problem-1
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;