[LeetCode] Maximum Star Sum of a Graph

2497. Maximum Star Sum of a Graph

There is an undirected graph consisting of n nodes numbered from 0 to n - 1. You are given a 0-indexed integer array vals of length n where vals[i] denotes the value of the ith node.

You are also given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting nodes ai and bi.

A star graph is a subgraph of the given graph having a center node containing 0 or more neighbors. In other words, it is a subset of edges of the given graph such that there exists a common node for all edges.

The image below shows star graphs with 3 and 4 neighbors respectively, centered at the blue node.

The star sum is the sum of the values of all the nodes present in the star graph.

Given an integer k, return the maximum star sum of a star graph containing at most k edges.

Read more
[LeetCode] Maximum Value of a String in an Array

2496. Maximum Value of a String in an Array

The value of an alphanumeric string can be defined as:

  • The numeric representation of the string in base 10, if it comprises of digits only.
  • The length of the string, otherwise.

Given an array strs of alphanumeric strings, return the maximum value of any string in strs.

Read more
[AtCoder] F - Select EdgesRead more
[AtCoder] C - K DerangementRead more
[AtCoder] F - Find 4-cycleRead more
[AtCoder] E - At Least OneRead more
[AtCoder] C - Split and MaximizeRead more
[Codeforces] Round #366 (Div. 1) A. ThorRead more
[Codeforces] Round #367 (Div. 2) C. Hard problemRead more
[Codeforces] Round #370 (Div. 2) C. Memory and De-EvolutionRead more