Alice and Bob have an undirected graph of n nodes and three types of edges:
Type 1: Can be traversed by Alice only.
Type 2: Can be traversed by Bob only.
Type 3: Can be traversed by both Alice and Bob.
Given an array edges where edges[i] = [typei, ui, vi] represents a bidirectional edge of type typei between nodes ui and vi, find the maximum number of edges you can remove so that after removing the edges, the graph can still be fully traversed by both Alice and Bob. The graph is fully traversed by Alice and Bob if starting from any node, they can reach all other nodes.
Return the maximum number of edges you can remove, or return-1if Alice and Bob cannot fully traverse the graph.
An undirected graph of n nodes is defined by edgeList, where edgeList[i] = [ui, vi, disi] denotes an edge between nodes ui and vi with distance disi. Note that there may be multiple edges between two nodes.
Given an array queries, where queries[j] = [pj, qj, limitj], your task is to determine for each queries[j] whether there is a path between pj and qj such that each edge on the path has a distance strictly less than limitj .
Return a boolean array answer, where answer.length == queries.length and the jth value of answer is true if there is a path for queries[j] is true, and false otherwise.
There are n bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb.
On the third round, you toggle every third bulb (turning on if it’s off or turning off if it’s on). For the ith round, you toggle every i bulb. For the nth round, you only toggle the last bulb.
Return the number of bulbs that are on after n rounds.
Solution
Each position is only switched on its factor rounds, and factors appear in pairs except when squared, where the factor is the same. Therefore, the problem is equivalent to finding the number of times a perfect square appears.
classSolution { public: intbulbSwitch(int n){ // bulbs will switch in factor round // since factor round will appear with pair // we just need to count square round
Augmented reality (AR) technology can be a valuable tool for architects during the design process, and my work demonstrates how AR can be used to enhance the design process. By combining models in Blender and using AI and prompts to generate images, we were able to select appropriate images and model them in Rhino, creating physical models using 3D printing.
To showcase these models, I developed an AR application in Unity and C# that uses QR code recognition to locate the model and display a virtual version in the app. With this AR technology, clients can swipe left and right or up and down in the app to replace different parts of the model with different materials, providing a visual representation of various material combinations. Additionally, clicking on the screen generates random agents that navigate through the model, providing an interactive experience between the architect and the building.