Skip to content

Instantly share code, notes, and snippets.

@sogwiz
sogwiz / maprcli.cmd
Created July 17, 2020 22:45
list of maprcli calls from an mcs api server session
maprcli cluster feature list -name mfs.feature.db.json.support
maprcli dashboard info
maprcli userconfig load
maprcli config load
maprcli license list
maprcli license apps
maprcli alarm view
maprcli alarm group listGroup
maprcli rlimit get -resource disk
maprcli acl userperms -type cluster -user root
//RECURSIVE
public TreeNode sortedArrayToBSTRecursive(int[] nums) {
if(nums == null)return null;
TreeNode root = sortedArrayToBSTHelper(nums,0,nums.length-1);
return root;
}
public TreeNode sortedArrayToBSTHelper(int[] nums, int begin, int end) {
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class OddEvenLinkedList {
public ListNode oddEvenList(ListNode head) {
package com.learning.leet.problems;
import java.util.HashMap;
import java.util.Map;
/**
* Created by sargonbenjamin on 7/17/19.
* https://leetcode.com/problems/lru-cache/
*/
public class LRUCache {
package com.learning.leet.tree;
/**
* Created by sargonbenjamin on 7/17/19.
* https://leetcode.com/problems/closest-binary-search-tree-value/
*/
public class ClosestBSTValue {
TreeNode minNode = null;
double minDelta = Double.MAX_VALUE;
package com.learning.leet.math;
/**
* Created by sargonbenjamin on 7/15/19.
* https://leetcode.com/explore/interview/card/top-interview-questions-easy/102/math/744/
*/
public class CountPrimes {
public int countPrimes(int n) {
if(n<=1)return 0;
package com.learning.leet.tree;
/**
* Created by sargonbenjamin on 7/10/19.
* https://leetcode.com/problems/count-complete-tree-nodes/
*/
public class CountCompleteTreeNodez {
public int countNodes(TreeNode root) {
if(root==null)return 0;
int leftMost = nodeDepthLeft(root);
package com.learning.leet.strsarrs;
/**
* Created by sargonbenjamin on 7/10/19.
* https://leetcode.com/problems/maximum-subarray/
*/
public class MaximumSubarray {
public static void main(String args[]){
public int mincostTickets(int[] days, int[] costs) {
Set<Integer> setRideDays = new HashSet<>();
for(int day : days){
setRideDays.add(day);
}
int[] minCostCache = new int[366];
for(int i = 0; i<minCostCache.length;i++){
minCostCache[i]=-1;
package com.learning.leet.problems;
import java.util.HashSet;
import java.util.Set;
/**
* Created by sargonbenjamin on 7/9/19.
* https://leetcode.com/problems/minimum-cost-for-tickets/
*/
public class MinCostForTickets {